答案1
免责声明:这不是 TikZ 的答案,但无论如何......
服用Thruston 对有关文本大纲的问题的回答作为参考,您可以执行以下操作来获得变形的 H 字母。这是一个概念证明,因此它仅适用于单个字母,但可以通过进一步调整将其调整为完整的单词。
\documentclass{standalone}
\usepackage[latex,shellescape]{gmp}
\begin{document}
\begin{mpost}[name=H]
picture nice;
path P, PP;
nice := image(draw thelabel(\btex H etex,origin));
%Transformation
vardef T(expr p) =
save x, y;
x := xpart p; y := ypart p;
%0.01 by guessing. Play with other values
(x,0.01x*y)
enddef;
%Assumes a cyclic path
%It can be done better
vardef TT(expr P) =
T(point 0 of P)
.. controls
T(postcontrol 0 of P) and T(precontrol 1 of P)
for j = 1 upto (length P - 1):
.. T(point j of P)
.. controls T(postcontrol j of P)
and T(precontrol (j+1) of P)
endfor
.. cycle
enddef;
for i within nice:
if textual i:
for j = 1 upto length textpart i:
string s; s := substring(j-1,j) of textpart i;
picture g; g := glyph ASCII s of fontpart i scaled 1/10;
picture r; r := image(
for x within g:
picture xx; xx := image(draw g);
%75 is also guessing. Try other values
%Bad filling. It works for the letter H, tho.
fill TT(pathpart x shifted (llcorner xx - ulcorner xx + 75right)) withcolor
if greypart x = 1:
1
else:
(1,0.843,0)
fi;
endfor
);
draw r;
endfor
fi
endfor
\end{mpost}\usempost{H}%
\end{document}
为了进行比较,这是字母 Q 的结果(应用假取消填充):