答案1
10pt 版本
\documentclass{article}
\usepackage{stackengine,marvosym,xcolor,trimclip}
\begin{document}
\stackinset{c}{}{c}{0.9pt}{%
\color{yellow!80!orange}\clipbox{0pt 4.0pt 0pt 2.2pt}{\Gentsroom}}{%
\stackinset{c}{}{c}{}{%
\color{yellow!80!orange}\clipbox{1.1pt 2.2pt 1.1pt 2.2pt}{\Gentsroom}}{%
\Gentsroom}}
\end{document}
12pt 版本
由于剪辑以 pt 为单位进行,因此不同的字体大小需要不同的\clipbox
值。
\documentclass[12pt]{article}
\usepackage{stackengine,marvosym,xcolor,trimclip}
\begin{document}
\stackinset{c}{}{c}{1pt}{%
\color{yellow!80!orange}\clipbox{0pt 4.6pt 0pt 2.6pt}{\Gentsroom}}{%
\stackinset{c}{}{c}{}{%
\color{yellow!80!orange}\clipbox{1.3pt 2.6pt 1.3pt 2.6pt}{\Gentsroom}}{%
\Gentsroom}}
\end{document}
当然,我知道你要说什么……
只需获取 png 格式的您最喜爱的球队徽标即可!
\documentclass[12pt]{article}
\usepackage{stackengine,marvosym,xcolor,trimclip,graphicx}
\begin{document}
\stackinset{c}{}{c}{}{\includegraphics[width=2pt]{Ravens}}{%
\stackinset{c}{}{c}{1pt}{%
\color{purple!55!blue}\clipbox{0pt 4.6pt 0pt 2.6pt}{\Gentsroom}}{%
\stackinset{c}{}{c}{}{%
\color{purple!55!blue}\clipbox{1.3pt 2.6pt 1.3pt 2.6pt}{\Gentsroom}}{%
\Gentsroom}}}
\end{document}
为了实现流程自动化,为了颜色和可扩展性,这里是\Tshirt[<size>]{<color>}
\documentclass[12pt]{article}
\usepackage{stackengine,marvosym,xcolor,trimclip,scalerel}
\newcommand\Tshirt[2][8.8pt]{\savestack\theTshirt{%
\stackinset{c}{}{c}{1pt}{%
\color{#2}\clipbox{0pt 4.6pt 0pt 2.6pt}{\Gentsroom}}{%
\stackinset{c}{}{c}{}{%
\color{#2}\clipbox{1.3pt 2.6pt 1.3pt 2.6pt}{\Gentsroom}}{%
\Gentsroom}}}%
\scaleto{\theTshirt}{#1}}
\begin{document}
\Gentsroom \Tshirt{yellow!80!orange}%
\Tshirt[18pt]{red}\Tshirt[30pt]{purple!55!blue}
\end{document}
答案2
您可以使用picture
模式。这会随字体大小缩放,但您也可以决定“绝对”高度。
\documentclass{article}
\usepackage{pict2e,xcolor}
\usepackage{marvosym}% for comparison
\definecolor{yellowshirt}{RGB}{255,211,6}
\newcommand{\Person}[1][0.87\ht\strutbox]{%
\begingroup\setlength\unitlength{#1}%
\begin{picture}(0.6,1)
\put(0.3,0.85){\circle*{0.28}}
\polygon*(0.075,0.3)(0.15,0.3)(0.15,0.55)(0.075,0.55)% left arm
\polygon*(0.45,0.3)(0.525,0.3)(0.525,0.55)(0.45,0.55)% right arm
\polygon*(0.17,0)(0.29,0)(0.29,0.3)(0.17,0.3)% left leg
\polygon*(0.31,0)(0.43,0)(0.43,0.3)(0.31,0.3)% right leg
\color{yellowshirt}
\polygon*(0.17,0.32)(0.43,0.32)(0.43,0.7)(0.17,0.7)% torso
\polygon*(0.075,0.55)(0.15,0.55)(0.15,0.7)(0.075,0.7)% left arm
\polygon*(0.45,0.55)(0.525,0.55)(0.525,0.7)(0.45,0.7)% right arm
\end{picture}\endgroup
}
\begin{document}
\Gentsroom\ \Person {\Huge\Gentsroom\ \Person} \Person[2cm]
\end{document}
答案3
下面的示例使用 FontForge 和 TikZ 获取 Gentroom 字形的 SVG 路径描述。
- 字体文件
TDS:fonts/type1/public/marvosym/marvosym.pfb
在 FontForge 中打开。 - 字形 Gentroom 位于位置 120,并且已打开。
字形描述导出为 SVG:
<?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > <svg viewBox="0 -200 1000 1000"> <g transform="matrix(1 0 0 -1 0 800)"> <path fill="currentColor" d="M220 728c53 0 101 -44 103 -99c0 -58 -34 -101 -87 -109h-32c-20 3 -37 11 -54 24l-19 25c-10 19 -14 33 -14 53c0 60 42 103 103 106zM49 504l52 -2v-294h-52v296zM117 504l206 -2v-278h-206v280zM338 504l52 -2v-294h-52v296zM117 208h94v-208h-94v208zM228 208h95v-208h-95v208z" /> </g> </svg>
d
路径描述,元素的属性值path
也可以通过 TikZ 库进行解析svg.path
。语言相当简单。操作符字母后面跟着参数。这里,我们需要:M
:绝对移动l
: 相对行h
:水平相对线v
:垂直相对线z
:关闭路径(cycle
在 TikZ 中)
SVG 路径在 TikZ 中被复制并修改。
带有注释的 LaTeX 文件结果:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{svg.path}
\usepackage{xcolor}
\definecolor{GentRoomTShirtColor}{HTML}{FFD800}
\begin{document}
\begin{tikzpicture}[scale=.1]% Adjust the scale factor above to your needs.
\fill svg{%
% Head [original]
M220 728c53 0 101 -44 103 -99c0 -58 -34 -101 -87 -109h-32c-20 3 -37 %
11 -54 24l-19 25c-10 19 -14 33 -14 53c0 60 42 103 103 106z%
% Left arm [original]
% M49 504l52 -2v-294h-52v296z
% Black part (two thirds) of left arm [new]
M49 405h52v-196h-52z%
% Torso [original]
% M117 504l206 -2v-278h-206v280z
% Right arm, original
% M338 504l52 -2v-294h-52v296z
% Black part (two thirds) of right arm [new]
M338 405h52v-196h-52z%
% Left leg [original]
% M117 208h94v-208h-94v208z
% Left leg [optimized]
M117 208h94v-208h-94z%
% Right leg [original]
% M228 208h95v-208h-95v208z
% Right leg [optimized]
M228 208h95v-208h-95z%
};
\fill[GentRoomTShirtColor] svg {%
% Upper part (one third) of left arm [new]
M49 503h52v-98h-52z%
% Torso [optimized]
M117 503h206v-277h-206z% torso
% Upper part (one third) of right arm [new]
M338 503h52v-98h-52z%
% Add side-bearings (additional white space on the left and right)
% of the original glyph or comment it , if you do not need them.
M0 0M439 0%
};
\end{tikzpicture}
\end{document}
评论:
- 坐标与 FontForge 中的相同。
- 字形描述包含一个奇怪之处(错误):与左上角相比,手臂和躯干的右上角降低了 2pt。此问题已在 LaTeX 示例中修复,以获得清晰的水平线。
- 我省略了将结果缩小到实际字形大小或类似大小的代码,因为我不知道新符号的用途。(如果需要将符号作为大图像,则缩小到字形大小是没有意义的。)
- 字形的原始侧轴承已添加,但如果需要,可以轻松将其删除,请参阅注释。
- 闭路运算符 (
z
) 连接到起点,因此不需要明确地转到起点。标记表示删除了[optimized]
之前到起点的最后一个线到操作。z
答案4
制定规则:
\documentclass{article}
\usepackage{wasysym,xcolor,graphicx}
\parindent0pt
\newcommand\Gent[1]{\resizebox{!}{#1em}{\parbox[b]{4em}{\makebox[3.2em]{\Huge$\CIRCLE$}\\
\rule[-.2em]{.5em}{3.2em}\,%
\rule{2em}{3em}\,\rule[-.2em]{.5em}{3.2em}\\[-2pt]
\rule{.5em}{0em}\,\rule{.8em}{3.2em}\,\,\rule{.8em}{3.2em}}}}
\newcommand\Tshirt[1]{\resizebox{!}{#1em}{\parbox[b]{4em}{\makebox[3.2em]{\color{orange}\Huge$\CIRCLE$}\\
\rlap{\color{yellow}\rule[-.2em]{.5em}{3.2em}}%
{\color{orange}\rule[-.2em]{.5em}{2.2em}}\,{\color{yellow}\rule{2em}{3em}}\,%
\rlap{\color{yellow}\rule[-.2em]{.5em}{3.2em}}%
{\color{orange}\rule[-.2em]{.5em}{2.2em}}\\[-2pt]
\rule{.5em}{0em}\,\rule{.8em}{3.2em}\,\,\rule{.8em}{3.2em}}}}
\begin{document}
\Gent{4} \Tshirt{4}
\Gent{3} \Tshirt{3}
\Gent{2} \Tshirt{2}
\Gent{1} \Tshirt{1}
\end{document}