Debian Codegraph @

texmf-dist/doc/fonts/spark-otf/spark-otf-doc.tex

raw
1 %% $Id: spark-otf-doc.tex 463 2022-03-03 07:27:02Z herbert $
2 %
3 \listfiles
4 \documentclass[fontsize=11pt,DIV=14,parskip=half-]{scrartcl}
5 \usepackage{fontspec}
6 \usepackage{graphicx}
7 \usepackage{multido,showexpl}
8 \usepackage[%usefilenames,
9 TT={Scale=0.88,FakeStretch=0.9},
10 SS={Scale=0.9},
11 RM={Scale=0.9},
12 DefaultFeatures={Ligatures=TeX}]{lucida-otf} % support opentype math fonts
13 \usepackage[usefilenames=false]{spark-otf} % support opentype spark fonts
14 \makeatletter
15 \let\SparkVersion\spark@version
16 \makeatother
17 \usepackage{unicodefonttable}
18
19 \newsavebox\ZBox \newsavebox\SBox
20
21 \usepackage{biblatex}
22 \addbibresource{\jobname.bib}
23
24 \usepackage{hvlogos} % for Wikipedia W
25
26 \pagestyle{headings}
27
28 \usepackage[colorlinks,hyperfootnotes=false]{hyperref}
29 % define \code for url-like breaking of typewriter fragments.
30 \ifx\nolinkurl\undefined \let\code\url \else \let\code\nolinkurl \fi
31
32 % Define \cs to prepend a backslash, and be unbreakable:
33 \DeclareRobustCommand\cs[1]{\mbox{\texttt{\char`\\#1}}}
34
35
36 \title{Support for the Spark OpenType fonts \\--\\ v.~\SparkVersion}
37 \author{Herbert Voß}
38 \begin{document}
39 \maketitle
40 \tableofcontents
41
42 \section{Introduction}
43
44 A sparkline is a very small line chart, typically drawn without axes or coordinates.
45 It presents the general shape of the variation (typically over time) in some measurement,
46 such as temperature or stock market price, in a simple and highly condensed way.
47 Sparklines are small enough to be embedded in text, or several sparklines may be
48 grouped together as elements of a small multiple. Whereas the typical chart is
49 designed to show as much data as possible, and is set off from the flow of text,
50 sparklines are intended to be succinct, memorable, and located where they are discussed.~\cite{wikipedia}
51
52
53 \section{The fonts}
54
55 The fonts are available from \url{https://github.com/aftertheflood/sparks} and should be saved
56 either in \path{Library/fonts/} (MAC OSX), \path{c:\Windows\Fonts} (Windows) or
57 \path{/usr/local/share/fonts} (Linux) or any other location where
58 the fonts will be found by the system.
59
60 \begin{verbatim}
61 Sparks-Bar-Extranarrow.otf
62 Sparks-Bar-Extrawide.otf
63 Sparks-Bar-Medium.otf
64 Sparks-Bar-Narrow.otf
65 Sparks-Bar-Wide.otf
66 Sparks-Dot-Extralarge.otf
67 Sparks-Dot-Extrasmall.otf
68 Sparks-Dot-Large.otf
69 Sparks-Dot-Medium.otf
70 Sparks-Dot-Small.otf
71 Sparks-Dotline-Extrathick.otf
72 Sparks-Dotline-Extrathin.otf
73 Sparks-Dotline-Medium.otf
74 Sparks-Dotline-Thick.otf
75 Sparks-Dotline-Thin.otf
76 \end{verbatim}
77 %-rw-r--r-- 1 voss voss 24708 Sep 15 11:20 Spark - Bar - Medium.otf
78 %-rw-r--r-- 1 voss voss 24696 Sep 15 11:20 Spark - Bar - Narrow.otf
79 %-rw-r--r-- 1 voss voss 24680 Sep 15 11:20 Spark - Bar - Thin.otf
80 %-rw-r--r-- 1 voss voss 22140 Sep 15 11:20 Spark - Dot-line - Medium.otf
81 %-rw-r--r-- 1 voss voss 24616 Sep 15 11:20 Spark - Dot - Medium.otf
82 %-rw-r--r-- 1 voss voss 24580 Sep 15 11:20 Spark - Dot - Small.otf
83
84
85 The package defines the following font macros (using symbol names):
86
87 \small
88 \begin{verbatim}
89 \newfontface\sparkBarMedium{Spark-Bar-Medium}[RawFeature=+calt,\spark@DefaultFeatures]
90 \newfontface\sparkBarNarrow{Spark-Bar-Narrow}[RawFeature=+calt,\spark@DefaultFeatures]
91 \newfontface\sparkBarExtranarrow{Spark-Bar-Extranarrow}[RawFeature=+calt,\spark@DefaultFeatures]
92 \newfontface\sparkBarWide{Spark-Bar-Wide}[RawFeature=+calt,\spark@DefaultFeatures]
93 \newfontface\sparkBarExtrawide{Spark-Bar-Extrawide}[RawFeature=+calt,\spark@DefaultFeatures]
94 %
95 \newfontface\sparkDotLineMedium{Spark-Dotline-Medium}[RawFeature=+calt,\spark@DefaultFeatures]
96 \newfontface\sparkDotLineThick{Spark-Dotline-Thick}[RawFeature=+calt,\spark@DefaultFeatures]
97 \newfontface\sparkDotLineExtrathick{Spark-Dotline-Extrathick}[RawFeature=+calt,\spark@DefaultFeatures]
98 \newfontface\sparkDotLineThin{Spark-Dotline-Thin}[RawFeature=+calt,\spark@DefaultFeatures]
99 \newfontface\sparkDotLineExtrathin{Spark-Dotline-Extrathin}[RawFeature=+calt,\spark@DefaultFeatures]
100 %
101 \newfontface\sparkDotMedium{Spark-Dot-Medium}[RawFeature=+calt,\spark@DefaultFeatures]
102 \newfontface\sparkDotSmall{Spark-Dot-Small}[RawFeature=+calt,\spark@DefaultFeatures]
103 \newfontface\sparkDotExtralarge{Spark-Dot-Extralarge}[RawFeature=+calt,\spark@DefaultFeatures]
104 \newfontface\sparkDotExtrasmall{Spark-Dot-Extrasmall}[RawFeature=+calt,\spark@DefaultFeatures]
105 \end{verbatim}
106
107 \normalsize
108
109 \section{The macros}
110
111 \begin{verbatim}
112 \sparkBar[<Type>][<No>]{values}[<No>]
113 \sparkDot[<Type>][<No>]{values}[<No>]
114 \sparkDotline[<Type>][<No>]{values}[<No>]
115 \sparkBar*[<Type>][<No>]{values}[<No>]
116 \sparkDot*[<Type>][<No>]{values}[<No>]
117 \sparkDotline*[<Type>][<No>]{values}[<No>]
118 \sparkBar[<Type>]{!value,values,...,!value}
119 \sparkDot[<Type>]{!value,values,...,!value}
120 \sparkDotline[<Type>]{!value,values,...,!value}
121 \sparkBar*[<Type>]{!value,values,...,!value}
122 \sparkDot*[<Type>]{!value,values,...,!value}
123 \sparkDotline*[<Type>]{!value,values,...,!value}
124 \end{verbatim}
125
126 If \texttt{[<Type>]} is missing, \texttt{Medium} is assumed. The type is mandatory if you use
127 the first \texttt{[<No>]} argument! The star versions are only valid for Lua\LaTeX\ where the values
128 can be of any interval. They will be changed to the allowed interval:
129
130 \begin{itemize}
131 \item for \cs{sparkDotline}: $[0,9]$
132 \item for all other: $[0,100]$
133 \end{itemize}
134
135
136 Instead of using the optional arguments for printing the first and/or last value you
137 can use the !-notation, then the first and/or last listed value are printed. There is no difference
138 in using the optional arguments; it saves only some keystrokes if the printed values are
139 the same as in the list.
140
141 \section{Text examples}
142
143 \subsection{Bars}
144
145 \typeout{Bar-Medium}%
146
147 \subsubsection{Bar-Medium}
148
149 \begin{LTXexample}[pos=t]
150 Text \sparkBar{14,95,68,9,19,41,91,1,81,97,79,45,96,76,17,65,8,92} Text\\
151 Text \sparkBar[Medium]{14,95,68,9,19,41,91,1,81,97,79,45,96,76,17,65,8,92} Text\\
152 Text \sparkBar[Medium][14]{14,95,68,9,19,41,91,1,81,97,79,45,96,76,17,65,8,92}[92] Text\\
153 Text \sparkBar{!14,95,68,9,19,41,91,1,81,97,79,45,96,76,17,65,8,!92} Text
154 \end{LTXexample}
155
156
157 \subsubsection{Bar-Narrow}
158
159 \begin{LTXexample}[pos=t]
160 Text \sparkBar[Narrow]{19,32,93,4,95,46,13,23,50,86,94,68,58,41,89,57,74,8} Text\\
161 Text \sparkBar[Narrow][19]{19,32,93,4,95,46,13,23,50,86,94,68,58,41,89,57,74,!8} Text\\
162 Text \sparkBar[Narrow]{!19,32,93,4,95,46,13,23,50,86,94,68,58,41,89,57,74,!8} Text
163 \end{LTXexample}
164
165
166 \subsubsection{Bar-Extranarrow}
167
168 \begin{LTXexample}[pos=t]
169 Text \sparkBar[Extranarrow]{19,32,93,4,95,46,13,23,50,86,94,68,58,41,89,57,74,8} Text\\
170 Text \sparkBar[Extranarrow][19]{19,32,93,4,95,46,13,23,50,86,94,68,58,41,89,57,74,!8} Text\\
171 Text \sparkBar[Extranarrow]{!19,32,93,4,95,46,13,23,50,86,94,68,58,41,89,57,74,!8} Text
172 \end{LTXexample}
173
174
175 \subsubsection{Bar-Wide}
176
177 \begin{LTXexample}[pos=t]
178 Text \sparkBar[Wide]{13,15,59,73,42,1,41,51,4,97,35,55,37,24,89,21,30,22} Text\\
179 Text \sparkBar[Wide][13]{13,15,59,73,42,1,41,51,4,97,35,55,37,24,89,21,30,22}[22] Text\\
180 Text \sparkBar[Wide]{!13,15,59,73,42,1,41,51,4,97,35,55,37,24,89,21,30,22} Text\\
181 Text \sparkBar[Wide]{!13,15,59,73,42,1,41,51,4,97,35,55,37,24,89,21,30,!22} Text
182 \end{LTXexample}
183
184
185 \subsubsection{Bar-Extrawide}
186
187 \begin{LTXexample}[pos=t]
188 Text \sparkBar[Extrawide]{13,15,59,73,42,1,41,51,4,97,35,55,37,24,89,21,30,22} Text\\
189 Text \sparkBar[Extrawide][13]{13,15,59,73,42,1,41,51,4,97,35,55,37,24,89,21,30,22}[22] Text\\
190 Text \sparkBar[Extrawide]{!13,15,59,73,42,1,41,51,4,97,35,55,37,24,89,21,30,22} Text\\
191 Text \sparkBar[Extrawide]{!13,15,59,73,42,1,41,51,4,97,35,55,37,24,89,21,30,!22} Text
192 \end{LTXexample}
193
194
195
196 \subsection{Dots}
197
198 \subsubsection{Dot-Medium -- the default}
199
200 \begin{LTXexample}[pos=t]
201 Text \sparkDot{54,39,26,65,29,58,36,99,16,56,76,69,71,77,7,40,79,1} Text\\
202 Text \sparkDot[Medium][54]{54,39,26,65,29,58,36,99,16,56,76,69,71,77,7,40,79,1}[1] Text\\
203 Text \sparkDot{!54,39,26,65,29,58,36,99,16,56,76,69,71,77,7,40,79,!1} Text
204 \end{LTXexample}
205
206
207 \subsubsection{Dot-Small}
208
209
210 \begin{LTXexample}[pos=t]
211 Text \sparkDot[Small]{1,79,88,46,54,77,91,24,70,22,27,29,40,33,31,95,26,76} Text\\
212 Text \sparkDot[Small][1]{1,79,88,46,54,77,91,24,70,22,27,29,40,33,31,95,26,76}[76] Text\\
213 Text \sparkDot[Small]{!1,79,88,46,54,77,91,24,70,22,27,29,40,33,31,95,26,!76} Text
214 \end{LTXexample}
215
216 \subsubsection{Dot-Extrasmall}
217
218 \begin{LTXexample}[pos=t]
219 Text \sparkDot[Extrasmall]{1,79,88,46,54,77,91,24,70,22,27,29,40,33,31,95,26,76} Text\\
220 Text \sparkDot[Extrasmall][1]{1,79,88,46,54,77,91,24,70,22,27,29,40,33,31,95,26,76}[76] Text\\
221 Text \sparkDot[Extrasmall]{!1,79,88,46,54,77,91,24,70,22,27,29,40,33,31,95,26,!76} Text
222 \end{LTXexample}
223
224
225 \subsubsection{Dot-Extralarge}
226
227 \begin{LTXexample}[pos=t]
228 Text \sparkDot[Extralarge]{1,79,88,46,54,77,91,24,70,22,27,29,40,33,31,95,26,76} Text\\
229 Text \sparkDot[Extralarge][1]{1,79,88,46,54,77,91,24,70,22,27,29,40,33,31,95,26,76}[76] Text\\
230 Text \sparkDot[Extralarge]{!1,79,88,46,54,77,91,24,70,22,27,29,40,33,31,95,26,!76} Text
231 \end{LTXexample}
232
233
234
235
236 \subsection{Dotline}
237
238 \subsubsection{Dotline-Thin}
239
240 \begin{LTXexample}[pos=t]
241 Text \sparkDotline[Thin]{1,79,88,46,54,77,91,24,70,22,27,29,40,33,31,95,26,76} Text\\
242 Text \sparkDotline[Thin][1]{1,79,88,46,54,77,91,24,70,22,27,29,40,33,31,95,26,76}[76] Text\\
243 Text \sparkDotline[Thin]{!1,79,88,46,54,77,91,24,70,22,27,29,40,33,31,95,26,!76} Text
244 \end{LTXexample}
245
246 \subsubsection{Dotline-Extrathin}
247
248 \begin{LTXexample}[pos=t]
249 Text \sparkDotline[Extrathin]{1,79,88,46,54,77,91,24,70,22,27,29,40,33,31,95,26,76} Text\\
250 Text \sparkDotline[Extrathin][1]{1,79,88,46,54,77,91,24,70,22,27,29,40,33,31,95,26,76}[76] Text\\
251 Text \sparkDotline[Extrathin]{!1,79,88,46,54,77,91,24,70,22,27,29,40,33,31,95,26,!76} Text
252 \end{LTXexample}
253
254
255
256 \subsubsection{Dotline-Medium -- the default}
257
258 \begin{LTXexample}[pos=t]
259 Text \sparkDotline{1,79,88,46,54,77,91,24,70,22,27,29,40,33,31,95,26,76} Text\\
260 Text \sparkDotline[Medium][1]{1,79,88,46,54,77,91,24,70,22,27,29,40,33,31,95,26,76}[76] Text\\
261 Text \sparkDotline{!1,79,88,46,54,77,91,24,70,22,27,29,40,33,31,95,26,!76} Text
262 \end{LTXexample}
263
264 \subsubsection{Dotline-Thick}
265
266 \begin{LTXexample}[pos=t]
267 Text \sparkDotline[Thick]{1,79,88,46,54,77,91,24,70,22,27,29,40,33,31,95,26,76} Text\\
268 Text \sparkDotline[Thick][1]{1,79,88,46,54,77,91,24,70,22,27,29,40,33,31,95,26,76}[76] Text\\
269 Text \sparkDotline[Thick]{!1,79,88,46,54,77,91,24,70,22,27,29,40,33,31,95,26,!76} Text
270 \end{LTXexample}
271
272 \subsubsection{Dotline-Extrathick}
273
274 \begin{LTXexample}[pos=t]
275 Text \sparkDotline[Extrathick]{1,79,88,46,54,77,91,24,70,22,27,29,40,33,31,95,26,76} Text\\
276 Text \sparkDotline[Extrathick][1]{1,79,88,46,54,77,91,24,70,22,27,29,40,33,31,95,26,76}[76] Text\\
277 Text \sparkDotline[Extrathick]{!1,79,88,46,54,77,91,24,70,22,27,29,40,33,31,95,26,!76} Text
278 \end{LTXexample}
279
280
281 \section{Examples for Lua\protect\LaTeX}
282 The current version of \texttt{spark-otf} supports only star versions for Lua\LaTeX.
283
284
285
286
287 \subsection{Bars}
288
289 \begin{LTXexample}[pos=t]
290 Text \sparkBar*{1,79,88,46,54,77,91,24,70,22,27,29,40,33,31,95,26,76} Text\\
291 Text \sparkBar*{9,4,2,1,6,7,3,8,3,7,1,4,9,2,8,5,1,8} Text\\
292 Text \sparkBar*[Narrow]{111,179,188,146,154,177,191,124,170,122,127,129,140,133,131,195,126,176} Text\\
293 \end{LTXexample}
294
295
296 \subsection{Dots}
297 \begin{LTXexample}[pos=t]
298 Text \sparkDotline*{1,79,88,46,54,77,91,24,70,22,27,29,40,33,31,95,26,76} Text\\
299 Text \sparkDotline{9,4,2,1,6,7,3,8,3,7,1,4,9,2,8,5,1,8} Text\\
300 Text \sparkDotline*{9,4,2,1,6,7,3,8,3,7,1,4,9,2,8,5,1,8} Text\\
301 Text \sparkDot*[Medium][19]{19,114,12,111,16,17,113,118,113,67,61,74,39,52,38,55,111,88}[88] Text\\
302 Text \sparkDotline*[Medium][111]{111,179,188,146,154,177,191,124,170,122,127,129,140,133,131,195,126,176}[176] Text
303 \end{LTXexample}
304
305
306
307 \section{Using color}
308 It is possible to mark single or some values with a specific color, which must
309 be given in binary notation, e.g. \verb|ff0000| for red (R-G-B). The macro \verb|\setSparkColor|
310 \emph{should} include the (last) comma after the value:
311
312 \begin{LTXexample}[pos=t]
313 Text \sparkBar{14,95,68,9,19,41,\setSparkColor{ff0000}{91,}1,81,97,79,45,96,76,17,65,8,92} Text
314 \sparkBar{!14,95,68,9,19,41,\setSparkColor{ff0000}{91,1,81,97,79,}45,96,76,17,65,8,!92} Text
315
316 \bigskip
317 \noindent
318 Text \sparkDot{14,95,68,9,19,41,\setSparkColor{ff0000}{91,}1,81,97,79,45,96,76,17,65,8,92} Text
319 \sparkDot{!14,95,68,9,19,41,\setSparkColor{ff0000}{91,1,81,97,79,}45,96,76,17,65,8,!92} Text
320 \end{LTXexample}
321
322 Coloring does \emph{not} work for the star version of the macro and \emph{not} for
323 \verb|\sparkDotline|.
324
325
326 \section{The charsets}
327
328 \subsection{Spark-BarMedium}
329
330 \displayfonttable*[range-start=F0000, range-end=FFFFF]{Sparks-Bar-Medium.otf}%[⟨font-features⟩]
331
332 \subsection*{Spark-BarNarrow}
333 \displayfonttable*[range-start=F0000, range-end=FFFFF]{Sparks-Bar-Narrow.otf}%[⟨font-features⟩]
334
335 \subsection*{Spark-BarExtraNarrow}
336 \displayfonttable*[range-start=F0000, range-end=FFFFF]{Sparks-Bar-Extranarrow.otf}%[⟨font-features⟩]
337
338 \subsection*{Spark-Bar-Wide}
339 \displayfonttable*[range-start=F0000, range-end=FFFFF]{Sparks-Bar-Wide.otf}%[⟨font-features⟩]
340
341 \subsection*{Spark-Bar-Extrawide}
342 \displayfonttable*[range-start=F0000, range-end=FFFFF]{Sparks-Bar-Extrawide.otf}%[⟨font-features⟩]
343
344 %\subsection*{Spark-BarThin}
345
346 \subsection*{Spark-DotMedium}
347 \displayfonttable*[range-start=F0000, range-end=FFFFF]{Sparks-Dot-Medium.otf}%[⟨font-features⟩]
348
349 \subsection*{Spark-DotSmall}
350 \displayfonttable*[range-start=F0000, range-end=FFFFF]{Sparks-Dot-Small.otf}%[⟨font-features⟩]
351
352 %\subsection*{Spark-DotLine-Medium}
353 %\displayfonttable*[range-start=F0000, range-end=FFFFF]{Sparks-Dotline-Medium.otf}%[⟨font-features⟩]
354
355 %\subsection*{Spark-DotLine-Thick}
356 %\displayfonttable*[range-start=F0000, range-end=FFFFF]{Sparks-Dotline-Thick.otf}%[⟨font-features⟩]
357
358 %\subsection*{Spark-DotLine-Extrathick}
359 %\displayfonttable*[range-start=F0000, range-end=FFFFF]{Sparks-Dotline-Extrathick.otf}%[⟨font-features⟩]
360
361
362
363 \nocite{*}
364 \printbibliography
365
366
367 \end{document}
368 %
369 \font\sparkDotlineThin ="file:Sparks-Dotline-Thin.otf:mode=node;+calt;\spark@DefaultFeatures"
370 \font\sparkDotlineExtrathin ="file:Sparks-Dotline-Extrathin.otf:mode=node;+calt;\spark@DefaultFeatures"
371 %
372 \font\sparkDotExtralarge="file:Sparks-Dot-Extralarge.otf:mode=node;+calt;\spark@DefaultFeatures"
373 \font\sparkDotExtrasmall="file:Sparks-Dot-Extrasmall.otf:mode=node;+calt;\spark@DefaultFeatures"
374
375
376
377 %\string{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1\string}
378
379
380
381 %-* !"\#\$\%'()*+,-./0123456789.;<=>@CDEGHILNOSTU[\textbackslash]\_ht\{\_\}°¢
382
383
384
385
386 <p class=spark-bar-medium>{14,95,68,9,19,41,91,1,81,97,79,45,96,76,17,65,8,92}</p>
387
388 <p class=spark-bar-narrow>{19,32,93,4,95,46,13,23,50,86,94,68,58,41,89,57,74,8}</p>
389
390 <p class=spark-bar-thin>{13,15,59,73,42,1,41,51,4,97,35,55,37,24,89,21,30,22}</p>
391
392 <p class=spark-dot-medium>{54,39,26,65,29,58,36,99,16,56,76,69,71,77,7,40,79,1}</p>
393
394 <p class=spark-dot-small>{1,79,88,46,54,77,91,24,70,22,27,29,40,33,31,95,26,76}</p>
395
396 <p class=spark-line-medium>{9,4,2,1,6,7,3,8,3,7,1,4,9,2,8,5,1,8}</p>
397 \NewDocumentCommand\spark{omo}{{\sparklinesbarmedium
398 \IfValueT{#1}{#1}\string{#2\string}\IfValueT{#3}{#3}}}