文字可以著色:
\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}
如何用 a 填滿字母或符號pattern
?
例如,一個充滿綠色磚塊的「我」看起來像這樣:
\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}