1

Text can be colored:

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

enter image description here

Areas can be filled with 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}

patterned square

How could you fill letters or symbols with a pattern?

For example, an "I" filled with green bricks would look something like this:

\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}

enter image description here

3

Conceptually this is very similar to this answer.

\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}

enter image description here

  • 1
    Thank you very much for your answer! I want to make sure I understand your method. You create a fading that is transparent except over the text. Then you make a node with the same text which you later use to size the rectangle you draw along the faded path. The patterns that are drawn in the rectangle come from #1 and the text comes from #2. Is this correct? – anonymous_pigeon Aug 7 at 19:48
  • 2
    @anonymous_pigeon Yes, more or less. #1 are keys that control the pattern, and the default is pattern=bricks. #2 is the text, as you say. There are many ways in which you could write the command, and one may use pgf keys to make it more flexible. – user121799 Aug 7 at 20:22
  • 1
    @anonymous_pigeon BTW, it is not too difficult to add the contour to the characters. You essentially need to add the tricks that are used here. (The more original posts are linked there.) – user121799 Aug 7 at 23:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.