summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/tikz-decofonts/tikz-decofonts-doc.tex
blob: 1f1868331d7450e2ec639e10d59f71b7d4109873 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
% !TeX TXS-program:compile = txs:///arara
% arara: pdflatex: {shell: no, synctex: no, interaction: batchmode}
% arara: pdflatex: {shell: no, synctex: no, interaction: batchmode}

\documentclass[11pt,a4paper]{ltxdoc}
\usepackage{amsmath}
\usepackage{bera}
\usepackage{inconsolata}
\usepackage[T1]{fontenc}
\usepackage[scale=0.875]{cabin}
\usepackage{tikz-decofonts}
\usepackage{fancyvrb}
\usepackage{fancyhdr}
\usepackage{tabularray}
\usepackage{fontawesome5}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\lfoot{\sffamily\small [tikz-decofonts]}
\cfoot{\sffamily\small - \thepage{} -}
\rfoot{\hyperlink{matoc}{\small\faArrowAltCircleUp[regular]}}
\usepackage{hologo}
\providecommand\tikzlogo{Ti\textit{k}Z}
\providecommand\TeXLive{\TeX{}Live\xspace}
\let\TikZ\tikzlogo

\usepackage{hyperref}
\urlstyle{same}
\hypersetup{pdfborder=0 0 0}
\usepackage[margin=2cm]{geometry}
\setlength{\parindent}{0pt}
\def\TPversion{0.1.1}
\def\TPdate{04/01/2025}
\usepackage{tcolorbox}
\tcbuselibrary{breakable,skins,hooks,listingsutf8}

\lstset{
	language=[LaTeX]TeX,%
	basicstyle=\ttfamily,%
	keywordstyle={\color{blue}},%
	classoffset=0,%
	keywords={},%
	alsoletter={-},%
	keywordstyle={\color{blue}},%
	classoffset=1,%
	alsoletter={-},%
	morekeywords={commalists-tools},%
	keywordstyle={\color{violet}},%
	classoffset=2,%
	alsoletter={-},%
	morekeywords={\tkzbrush,\tkzink,\tkzpixl,\tkzpixletter,\tkzpixlquote},%
	keywordstyle={\color{green!50!black}},%
	classoffset=3,%
	morekeywords={},%
	keywordstyle={\color{orange}}
}

\newtcblisting{DemoCode}[1]{%
	enhanced,width=\linewidth,%
	bicolor,size=title,%
	colback=cyan!10!white,%
	colbacklower=cyan!5!white,%
	colframe=cyan!75!black,%
	listing options={%
		breaklines=true,%
		breakatwhitespace=true,%
		style=tcblatex,basicstyle=\small\ttfamily,%
		tabsize=4,%
		commentstyle={\itshape\color{gray}},
		keywordstyle={\color{blue}},%
		classoffset=0,%
		keywords={\usepackage,\includegraphics,xstring,listofitems,\readlist,\showitems,\xintFor,\xintSeq},%
		alsoletter={-},%
		keywordstyle={\color{blue}},%
		classoffset=1,%
		alsoletter={-},%
		morekeywords={euromoney},%
		keywordstyle={\color{violet}},%
		classoffset=2,%
		alsoletter={-},%
		morekeywords={\tkzbrush,\tkzink,\tkzpixl,\tkzpixletter,\tkzpixlquote,\tkzbicolor},%
		keywordstyle={\color{green!50!black}},%
		classoffset=3,%
		morekeywords={color,lines,scale,height,offseth,offsetv,thick,gridcolor,gridafter,nospaceafter,border,colors,style,intdelta,paralcolors},%
		keywordstyle={\color{orange}}
	},%
	#1
}

\newtcbinputlisting\DemoCodeFile[1]{%
	enhanced,width=\linewidth,%
	bicolor,size=title,%
	colback=lightgray!10!white,%
	colbacklower=lightgray!5!white,%
	colframe=lightgray!75!black,%
	listing options={%
		breaklines=true,%
		breakatwhitespace=true,%
		style=tcblatex,
		basicstyle=\scriptsize\ttfamily,%
		tabsize=4,%
		commentstyle={\itshape\color{gray}},%
		%lastline=148
	},%
	breakable,
	listing only,%
	listing file={#1}
}

\NewDocumentCommand\ShowCode{ m }{%
	\lstinline{#1}%
}

\def\sampleformula{$\displaystyle\int_0^1 \dfrac{1+x}{1+x^2}\,\mathrm{d}x$}
\def\sampletxt{But I must explain to you how all this mistaken idea of denouncing pleasure.}
\def\samplenum{1500}

\begin{document}

\thispagestyle{empty}

\begin{center}
	\begin{minipage}{0.88\linewidth}
		\begin{tcolorbox}[colframe=yellow,colback=yellow!15]
			\begin{center}
				\renewcommand{\arraystretch}{1.25}%
				\begin{tabular}{c}
					{\Huge \texttt{tikz-decofonts}}\\
					\\
					{\LARGE Simple "decoration" fonts, made} \\
					{\LARGE with Ti\textit{k}Z, for small texts\ldots} \\
					\\
					{\small \texttt{Version \TPversion{} -- \TPdate}}
				\end{tabular}
			\end{center}
		\end{tcolorbox}
	\end{minipage}
\end{center}

\begin{center}
	\begin{tabular}{c}
		\texttt{Cédric Pierquet}\\
		{\ttfamily c pierquet -- at -- outlook . fr}\\
		\texttt{\url{https://github.com/cpierquet/tikz-decofonts}} \\
	\end{tabular}
\end{center}

\hrule

\vfill

\begin{tcblisting}{colframe=lightgray,colback=lightgray!5,listing only}
%paintbrush effect
\tkzbrush[color=blue]{DECORATION}
%paintink effect
\tkzink[color=orange]{DECORATION}
%pixeletter effect
\tkzpixl[color=violet]{DECORATION}
%bicolor effect
\tkzbicolor[colors=blue/red,style=ndiag]{\Huge\sffamily DECORATION}
\tkzbicolor[colors=teal/orange,style=ellips]{\Huge\sffamily DECORATION}
\end{tcblisting}

\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5]
\tkzbrush[color=blue]{DECORATION}
\end{tcolorbox}

\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5]
\hfill\tkzink[color=orange]{DECORATION}\hfill~
\end{tcolorbox}

\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5]
\hfill\tkzpixl[color=violet]{Decoration}
\end{tcolorbox}

\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5]
\hfill\tkzbicolor[colors=blue/red,style=ndiag]{\Huge\sffamily DECORATION}~~\tkzbicolor[colors=teal/orange,style=ellips]{\Huge\sffamily DECORATION}\hfill~
\end{tcolorbox}

\vfill~

\hrule

\vspace*{5mm}

\textit{Ideas and parts of codes, with \texttt{CC\,BY-SA\,4.0} licenses, come from :}

\begin{itemize}
	\item \href{https://tex.stackexchange.com/questions/475141/simulating-paintbrush-strokes-in-tikz}{[link on tex.stackexchange]} from \textsf{user121799} for paintbrush;
	\item \href{https://tex.stackexchange.com/questions/460836/custom-line-cap-to-simulate-inked-line-in-tikz/460842#460842}{[link on tex.stackexchange]} from \textsf{user121799} for inkbrush.
\end{itemize}

\pagebreak

\phantomsection

\hypertarget{matoc}{}

\tableofcontents

\vspace*{5mm}

%\hrule

\pagebreak

\section{Loading, useful packages, purposes and acknowledgments}

\subsection{Loading and useful packages}

In order to load \texttt{tikz-decofonts}, simply use:

\begin{DemoCode}{listing only}
\usepackage{tikz-decofonts}
\end{DemoCode}

Loaded packages are \texttt{tikz}, \texttt{xintexpr}, \texttt{simplekv}, \texttt{listofitems} and \texttt{xstring}.

Loaded \texttt{tikz.librairies} are \texttt{decorations}, \texttt{decorations.pathreplacing}, \texttt{calc}, \texttt{positioning}, \texttt{bbox}, \texttt{arrows.meta} and \texttt{bending}.

\smallskip

Globally, height of rendering is about 1cm, but some customization are available.

\subsection{Purposes and acknowledgments}

The purposes of this small package is not to provide full fonts, with all characters, but give restricted possibility to present \textbf{short} texts of title with \textit{cute} effects.

\smallskip

These decorations are not destined to be use for whole paragraphs or texts, but just for fun for small titles or small texts.

\smallskip

Since many calculations are required internally, compilation time can be increased, so be careful with intensive use!

\smallskip

\textit{Ideas and parts of codes, with \texttt{CC\,BY-SA\,4.0} licenses, come from:}

\begin{itemize}
	\item \href{https://tex.stackexchange.com/questions/475141/simulating-paintbrush-strokes-in-tikz}{[link on tex.stackexchange]} from \textsf{user121799} for paintbrush;
	\item \href{https://tex.stackexchange.com/questions/460836/custom-line-cap-to-simulate-inked-line-in-tikz/460842#460842}{[link on tex.stackexchange]} from \textsf{user121799} for inkbrush.
\end{itemize}

Some adjustments (keys, paths) are maid from original code, but the global usage is due to the links above !

\pagebreak

\section{The different effects}

\subsection{Paint brush}

{\small\faBomb} The effect is \textbf{very} \textit{time-consuming} to compile !!

\begin{DemoCode}{listing only}
%only uppercase letters allowed
\tkzbrush[color=...,lines=...,scale=...]<tikzpicture options>{short text}

%color = black by default
%lines = 12 by default
%scale = 1 by default
\end{DemoCode}

\begin{DemoCode}{listing only}
%default output
\tkzbrush{TIKZ DECORATION}
\end{DemoCode}

\begin{DemoCode}{text only}
%default output
\tkzbrush{TIKZ DECORATION}

\end{DemoCode}

\begin{DemoCode}{listing only}
%customization(s) (external file for speeding rendering ^^)
\tkzbrush[color=red,lines=20,scale=1.5]{CUSTOM TEXT}
\end{DemoCode}

\begin{DemoCode}{text only}
%customization(s) (external file for speeding rendering ^^)
\includegraphics{tkzbrushA.pdf}
\end{DemoCode}

\pagebreak

\subsection{Ink brush}

\begin{DemoCode}{listing only}
%only uppercase letters allowed
\tkzink[color=...,thick=...,scale=...]<tikzpicture options>{short text}

%color = black by default
%thick = 3 by default
%scale = 1 by default
\end{DemoCode}

\begin{DemoCode}{}
%default output
\tkzink{TIKZ DECORATION}
\end{DemoCode}

\begin{DemoCode}{}
%customization(s)
\tkzink[color=olive,thick=5,scale=2]{TIKZ DECORATION}
\end{DemoCode}

\pagebreak

\subsection{Pixl brush}

\begin{DemoCode}{listing only}
%regular letters allowed (upper and/or lower), rendered characters are 5 columns x 7 lines
\tkzpixl%
    [height=...,thick=...,color=...,gridcolor=...,border=...,
    offseth=...,offsetv=...,gridafter=...,nospaceafter=...]
    <tikzpicture options>{short text}

\tkzpixletter%
    [height=...,thick=...,color=...,gridcolor=...,border=...,
    offseth=...,offsetv=...,gridafter=...,nospaceafter=...]
    <tikzpicture options>{letter}

\tkzpixlquote%if problem with '...
    [height=...,thick=...,color=...,gridcolor=...,
    offseth=...,offsetv=...,gridafter=...,nospaceafter=...]
    <tikzpicture options>

%height = 11mm by default, thick = 0.1mm by default
%color = black by default, gridcolor = gray by default
%offseth = 1 by default (squares left/right of regular character)
%offsetv = 2 by default (squares above/below of regular character)
%boder = false by default (boolean for adding border)
%gridafter = false by default (boolean for showing grid after pixls)
%nospaceafter = false by default (boolean for removeing hspace after pixls)
\end{DemoCode}

\begin{DemoCode}{}
%default output, comparaison with character w/o offsets (5*7)
\tkzpixl{And then, 1+1=2 !?!} and \tkzpixletter[offseth=0,offsetv=0]{*}
\end{DemoCode}

\begin{DemoCode}{}
%customization(s)
\tkzpixl[color=violet,height=1.75cm,gridafter,offsetv=3,border]{Small custo'm text}
\end{DemoCode}

\pagebreak

\subsection{Bicolor effect}

\begin{DemoCode}{listing only}
%compatible with all fonts and/or sizes
\tkzbicolor%
    [colors=...,style=...,intdelta=...]
    {text}

\tkzbicolor%with paral style
    [paralcolors=...,style=paral,intdelta=...]
    {text}

%style = midh/midv/rect/ellips/paral (paral by default)
%colors = red/blue by default,
%paralcolors = red/blue/orange/gray by default
%intdelta = 0.66 by default, percentage of int dim for ellips/rect
\end{DemoCode}

\begin{DemoCode}{listing only}
\def\sampleformula{$\displaystyle\int_0^1 \dfrac{1+x}{1+x^2}\,\mathrm{d}x$}
\def\sampletxt{But I must explain to you how all this mistaken idea of denouncing pleasure.}
\def\samplenum{1500}
\end{DemoCode}

\begin{DemoCode}{}
\tkzbicolor[style=midh]{\sampleformula} 
or \tkzbicolor[colors=violet/magenta,style=midv]{\sampleformula}
or \tkzbicolor[colors=darkgray/olive,style=ndiag]{\sampleformula}
or \tkzbicolor[colors=orange/teal,style=sdiag]{\sampleformula}
or \tkzbicolor[colors=orange/teal,style=ellips]{\sampleformula}
or \tkzbicolor[colors=pink/violet,style=rect]{\sampleformula}
\end{DemoCode}

\begin{DemoCode}{}
\tkzbicolor[style=midh]{\sampletxt}\par
\tkzbicolor[colors=violet/magenta,style=midv]{\sampletxt}\par
\tkzbicolor[colors=darkgray/olive,style=ndiag]{\sampletxt}\par
\tkzbicolor[colors=orange/teal,style=sdiag]{\sampletxt}\par
\tkzbicolor[colors=orange/teal,style=ellips]{\sampletxt}\par
\tkzbicolor[colors=pink/violet,style=rect]{\sampletxt}
\end{DemoCode}

\begin{DemoCode}{}
\tkzbicolor[style=midh]{\parbox{2.5cm}{\sampletxt}} 
\tkzbicolor[colors=violet/gray,style=midv]{\parbox{2.5cm}{\sampletxt}} 
\tkzbicolor[colors=darkgray/olive,style=ndiag]{\parbox{2.5cm}{\sampletxt}} 
\tkzbicolor[colors=orange/cyan,style=sdiag]{\parbox{2.5cm}{\sampletxt}} 
\tkzbicolor[colors=pink/violet,style=ellips]{\parbox{2.5cm}{\sampletxt}} 
\tkzbicolor[colors=pink/violet,style=ellips,intdelta=0.85]{\parbox{2.5cm}{\sampletxt}} 
\tkzbicolor[colors=cyan/darkgray,style=rect]{\parbox{2.5cm}{\sampletxt}}
\end{DemoCode}

\begin{DemoCode}{}
\tkzbicolor[style=paral]{\parbox{6cm}{\large\sffamily\sampletxt}}
\end{DemoCode}

\begin{DemoCode}{}
\tkzbicolor[style=midh]{\samplenum}\par
\tkzbicolor[colors=violet/magenta,style=midv]{\samplenum}\par
\tkzbicolor[colors=darkgray/olive,style=ndiag]{\samplenum}\par
\tkzbicolor[colors=orange/teal,style=sdiag]{\samplenum}\par
\tkzbicolor[colors=orange/teal,style=ellips]{\samplenum}
\end{DemoCode}


\pagebreak

\section{History}

\texttt{0.1.1: Bicolor effect}

\texttt{0.1.0: Initial version}

\end{document}