~tex-sx/tex-sx/development

« back to all changes in this revision

Viewing changes to letter-shapes-test.tex

  • Committer: Andrew Stacey (Thargelion)
  • Date: 2011-06-05 20:34:05 UTC
  • Revision ID: stacey@math.ntnu.no-20110605203405-aozimho6cnnyyx29
Started to split off soft path manipulation stuff in to a separate style file, also reimplementing the code a bit

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
\immediate\write18{tex pgflibraryshapes.letters.dtx}
2
 
%\documentclass[border=10]{standalone}
3
 
\documentclass{article}
4
 
\pagestyle{empty}
5
 
\thispagestyle{empty}
6
 
\usepackage{tikz}
7
 
\usetikzlibrary{
8
 
  shapes.letters,
9
 
  decorations.pathmorphing,
10
 
  decorations.pathreplacing,
11
 
  decorations.text,
12
 
  decorations.footprints,
13
 
  fadings,
14
 
}
15
 
 
16
 
 
17
 
\pgfmathsetmacro{\emcm}{1em/1cm}
18
 
\pgfkeys{
19
 
  /pgf/letter/.cd,
20
 
%  load font={stikz}{italic},
21
 
  load font={stikz}{normal},
22
 
  size=4,
23
 
  load encoding=char,
24
 
  every letter/.append style={
25
 
    fill,
26
 
  },
27
 
  sentence width=.9\textwidth,
28
 
}
29
 
 
30
 
 
31
 
\begin{document}
32
 
\begin{tikzpicture}[every letter/.append style={path fading=west}]
33
 
\node[letter=A] (A) {};
34
 
\node[letter=b,right of previous letter,at=(A.east)] (b) {};
35
 
\node[letter=c,right of previous letter,at=(b.east)] (c) {};
36
 
\node[letter=T] (T) at (0,-3) {};
37
 
\node[letter=i,right of previous letter,at=(T.east)] (i) {};
38
 
\node[letter=k,right of previous letter,at=(i.east)] (k) {};
39
 
\node[letter=Z,right of previous letter,at=(k.east)] (Z) {};
40
 
\end{tikzpicture}
41
 
 
42
 
 
43
 
\begin{tikzpicture}
44
 
\drawword[red]{(0,4)}{TikZ}
45
 
\drawword[red,
46
 
  every letter/.append style={
47
 
    decorate,
48
 
    decoration={
49
 
      text along path,
50
 
      text={The PGF package, where ``PGF'' is supposed to mean ``portable graphics format'' (or ``pretty, good, functiona'' if you prefer ...)}
51
 
    }
52
 
  }]{(0,0)}{TikZ}
53
 
\drawword[red,
54
 
  every letter/.append style={
55
 
    decorate,
56
 
    decoration={bumps}
57
 
  }]{(0,-4)}{TikZ}
58
 
\drawword[red,
59
 
  every letter/.append style={
60
 
    decorate,
61
 
    decoration={random steps}
62
 
  }]{(0,-8)}{TikZ}
63
 
\end{tikzpicture}
64
 
 
65
 
\begin{tikzpicture}
66
 
\drawword[red,
67
 
  every letter/.append style={
68
 
    decorate,
69
 
    decoration={snake}
70
 
  }]{(0,-12)}{TikZ}
71
 
\end{tikzpicture}
72
 
 
73
 
\begin{tikzpicture}
74
 
\drawword[red,
75
 
  every letter/.append style={
76
 
    fill=none,
77
 
    draw,
78
 
    decorate,
79
 
    decoration={ticks}
80
 
  }]{(0,0)}{TikZ}
81
 
\drawword[red,
82
 
  every letter/.append style={
83
 
    fill=none,
84
 
    draw,
85
 
    decorate,
86
 
    decoration={waves}
87
 
  }]{(0,-4)}{TikZ}
88
 
\drawword[red,
89
 
  every letter/.append style={
90
 
    fill=none,
91
 
    draw,
92
 
    decorate,
93
 
    decoration={footprints}
94
 
  }]{(0,-4)}{TikZ}
95
 
\end{tikzpicture}
96
 
 
97
 
\drawsentence[baseline=0pt,every node/.style={fill},/pgf/letter/size=\emcm]{
98
 
Shadows seem to move around you.
99
 
There, did you see it?
100
 
}
101
 
\end{document}
102
 
Of course, it was only your imagination.
103
 
There's nothing there, really.
104
 
Being a rational scientist, you tell yourself that there cannot be anything behind you.
105
 
But just as you convince yourself that the movements are figments of your imagination, you remember the words of Nils Bohr: "I've heard that it works even if you don't believe in it."
106
 
Perhaps the shadows really are there, even if you don't believe in them.
107
 
But, no.
108
 
They don't exist.
109
 
You know they don't exist.
110
 
The question is: do they know?
111
 
Beware the Vashta Nerada.
112
 
Count the shadows.
113
 
}
114
 
\end{document}
115
 
 
116
 
\begin{raggedright}
117
 
\noindent\typesetsentence[baseline=0pt,letter/size=\emcm,every node/.style={fill}]{Hello world, how are you? What happens if we go on, and on, and on?}
118
 
\end{raggedright}
119
 
 
120
 
\begin{tikzpicture}
121
 
\node[draw,letter=y] (y) {};
122
 
\foreach \anchor in {
123
 
  north,
124
 
  south,
125
 
  east,
126
 
  west,
127
 
  base,
128
 
  center,
129
 
  mid east,
130
 
  mid west,
131
 
  base east,
132
 
  base west%
133
 
} {
134
 
  \fill (y.\anchor) circle[radius=2pt];
135
 
  \node[above] at (y.\anchor) {\anchor};
136
 
}
137
 
\typesetword[every node/.style={draw}]{(0,-5)}{TikZ}
138
 
\end{tikzpicture}
139
 
\def\insanity{0}
140
 
\madman[
141
 
  transform canvas={
142
 
    scale=\emcm/2
143
 
  },
144
 
  letter/sentence width=6\textwidth,
145
 
  letter/madman quotient=0,
146
 
  letter/every line/.style={
147
 
    increase insanity,
148
 
  },
149
 
  increase insanity/.code={%
150
 
    \pgfmathsetmacro{\insanity}{\insanity + 0.1*(1 - \insanity)^2}%
151
 
    \global\let\insanity=\insanity
152
 
    \pgfkeys{/tikz/letter/madman quotient/.expand once=\insanity}%
153
 
  }
154
 
]{%
155
 
 
156
 
% Local Variables:
157
 
% tex-output-type: "pdf18"
158
 
% End: