パターンでテキストを塗りつぶす

パターンでテキストを塗りつぶす

テキストに色を付けることができます:

\documentclass{standalone}
\usepackage{xcolor}
\begin{document}
{\textcolor{green}{\Large I}}
\end{document}

ここに画像の説明を入力してください

エリアは以下で埋めることができますpatterns:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{patterns}
\begin{document}
\begin{tikzpicture}
\draw[pattern=bricks, pattern color=green] (0,0) -- (0,1) -- (1,1) -- (1,0) -- cycle;
\end{tikzpicture}
\end{document}

模様のある正方形

文字や記号を で埋めるにはどうすればいいですかpattern?

たとえば、緑色のレンガで埋め尽くされた「I」は次のようになります。

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{patterns}
\begin{document}
\begin{tikzpicture}
% shouldn't need to trace a symbol!
\draw[pattern=bricks, pattern color=green] (0,0) -- (3,0) -- (3,1) -- (2,1) -- (2,3) -- (3,3) -- (3,4) -- (0, 4) -- (0,3) -- (1,3) -- (1,1) -- (0,1) -- cycle;
\end{tikzpicture}
\end{document}

ここに画像の説明を入力してください

答え1

概念的にはこれはこの答え

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{fadings,patterns}
\begin{document} 
\newcommand\textpattern[2][pattern=bricks]{%
\begin{tikzfadingfrompicture}[name=letter]
\node [text=transparent!0,scale=10,font=\bfseries\sffamily] {#2};
\end{tikzfadingfrompicture}
\begin{tikzpicture}
\node [opacity=0,scale=10,font=\bfseries\sffamily] (aux) {#2};
\path[path fading=letter,fit fading=false,#1]
    (aux.south west) rectangle (aux.north east);
\end{tikzpicture}}
\textpattern{Hello}

\textpattern[pattern=bricks,pattern color=green]{world!}
\end{document}

ここに画像の説明を入力してください

関連情報