
答案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 的結果(應用假未填充):