tikz를 사용하여 단일 문자 변환

tikz를 사용하여 단일 문자 변환

나는 제목 페이지의 한 글자를 매우 구체적인 방식으로 변형하고 싶습니다. 달성하려는 효과를 설명하기 위해 이미지를 첨부했습니다. 문자 H의 왼쪽 절반이 오른쪽 절반보다 짧지만 문자의 상단은 수평임을 확인하세요. 나는 tikz를 사용하여 어떤 방식으로든 그것을 왜곡하고 싶을 것이라고 생각하지만, 이것을 어떻게 달성할 수 있을지 잘 모르겠습니다. 누구든지 도와줄 수 있나요?

늘어난 문자 H

답변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에 대한 결과입니다(가짜 채우기 적용).

여기에 이미지 설명을 입력하세요

관련 정보