Debian Codegraph @

texmf-dist/source/fonts/arsenal/arsenal.dtx

raw
1 % \iffalse meta-comment
2 %
3 % File: arsenal.dtx
4 % Copyright 2023-2025 by Boris Veytsman
5 %
6 % It may be distributed and/or modified under the conditions of the
7 % LaTeX Project Public License (LPPL), either version 1.3c of this
8 % license or (at your option) any later version. The latest version
9 % of this license is in the file
10 %
11 % https://www.latex-project.org/lppl.txt
12 %
13 %<*driver>
14 \documentclass{l3doc}
15 \usepackage[default]{arsenal}
16 \usepackage{natbib, booktabs}
17 \usepackage[tableposition=top]{caption}
18 \urlstyle{rm}
19 \begin{document}
20 \RecordChanges
21 \DocInput{\jobname.dtx}
22 \end{document}
23 %</driver>
24 % \fi
25 % \GetFileInfo{arsenal.sty}
26 % \title{\pkg{arsenal}---\LaTeX\ support of Arsenal fonts by Andrij Shevchenko}
27 % \date{\fileversion, \filedate}
28 % \author{Boris
29 % Veytsman\thanks{\href{mailto:[email protected]}{[email protected]},
30 % \href{mailto:[email protected]}{[email protected]}}}
31 % \maketitle
32 % \begin{abstract}
33 % Arsenal is the font created by Andrij Shevchenko. It won
34 % Ukrainian Type Design Competition `Mystetsky Arsenal' in 2011.
35 % This package provides \LaTeX\ support for it and matching math
36 % fonts.
37 % \end{abstract}
38 % \tableofcontents
39 % \begin{documentation}
40 %
41 %\section{User manual}
42 %\label{sec:ug}
43 %
44 %
45 %\subsection{Introduction}
46 %\label{sec:ug-intro}
47 %
48 % In 2011 the Ukrainian Type Design Competition ``Mystetsky Arsenal''
49 % (\url{http://www.ukrainian-type.com/about/}) was won by the font by
50 % Andrij Shevchenko. The competiton was aimed at the creation of a
51 % modern practical font based on Ukrainian traditions. The winner is
52 % remarkable for its clarity and clean shapes.
53 %
54 % Later the font was extended by Alexei Vanyashin \& cyreal.org, Nhung
55 % Nguyen, and Marc Foley (see
56 % \url{https://github.com/alexeiva/Arsenal}). The font now supports a
57 % large number of languages with Latin and Cyrillic alphabet, it has
58 % real small caps, historic forms, swash capitals and many other
59 % features.
60 %
61 % This package provides
62 % \LaTeX\ interface for the font. The math support is done by
63 % \pkg{ArsenalMath} package by Rajeesh KV~\cite{arsenal-math}---I am
64 % deeply grateful to Rajeev for his great work. The command
65 % \cs{mathcal} uses Swash letters from Arsenal.
66 %
67 % Since the font it in \textsc{otf} format, you do need a Unicode
68 % engine like \XeTeX\ or Lua\TeX\ to use it.
69 %
70 %
71 %\subsection{Package options}
72 %\label{sec:ug-options}
73 %
74 % \begin{variable}{default, sfdefault, math, scale, Scale}
75 % \changes{v0.2}{2023/09/04}{Added arsenal+kpsans value for math
76 % option}
77 % \changes{v1.0}{2025/10/13}{Made math option boolean}
78 % The options for the package use the key-value interface.
79 % The part |=true| for the boolean options can be dropped.
80 %
81 % The following options are recognized:
82 % \begin{description}
83 % \item[default] whether to make Arsenal the main font of the
84 % document, either |true| (the default) or |false|.
85 % \item[sfdefault] whether to make Arsenal the sans serif font of your
86 % document, either |true| or |false| (the default).
87 % \item[math] whether to enable math support, either |true| or
88 % |false|. By default |true| if Arsenal is the main font, and
89 % |false| otherwise. Historically Arsenal provided the options to
90 % use KpSans and Iwona for
91 % math. Since Rajeesh KV wrote the package~\cite{arsenal-math}, they
92 % are obsolete.
93 % \item[scale] the scale for the font, by default 0.89. The option
94 % |Scale| is a synonym.
95 % \end{description}
96 % \end{variable}
97 %
98 %
99 %\subsection{Font features}
100 %\label{sec:ug-families}
101 %
102 % \begin{function}{\arsenalfamily, \textarsenal}
103 % \begin{syntax}
104 % \cs{arsenalfamily} \meta{text}
105 % \cs{textarsenal}\Arg{text}
106 % \end{syntax}
107 % The font provides the commands \cs{arsenalfamily} and
108 % \cs{textarsenal} for selecting the font. Alternatively, the NFSS
109 % commands \cs{fontfamily}|{arsenal}|\cs{selectfont} can be used to
110 % select Arsenal family.
111 % \end{function}
112 %
113 % The font has normal and \textit{italic} shapes, as well as bolded
114 % \textbf{bold} and \textbf{\itshape bold italic}. It has
115 % \textsc{Small Caps}, \textsc{\itshape Italic Small Caps},
116 % \textsc{\bfseries Bold Small Caps} and \textsc{\bfseries\itshape
117 % Bold Italic Small Caps}. They are selected by the standard \LaTeX\
118 % commands.
119 %
120 % \begin{function}{\swshape, \textsw}
121 % The font has Swash shape, selected by the commands \cs{swshape}
122 % and \cs{textsw}. There are both normal and bold versions:
123 % \textsw{SWASH}, \textsw{\bfseries Bold SWASH}. Moreover, there is
124 % an italic version \textsw{\itshape SWASH},
125 % \textsw{\bfseries\itshape Bold SWASH}, and even a small caps
126 % version \textsw{\scshape Swash}, \textsw{\scshape\bfseries Bold
127 % Swash}.
128 %
129 % \end{function}
130 %
131 % The font has other features, such are two alternate forms and
132 % historic style. They can be selected by the
133 % \pkg{fontspec}~\citep{fontspec} commands like
134 % |\addfontfeatures{Style=Historic}| or
135 % |\addfontfeautures{Alternate=1}|.
136 %
137 %
138 %
139 %\subsection{Special symbols in text}
140 %\label{sec:chars}
141 %
142 % \begin{function}{
143 % \texthryvnia,
144 % \texttugrik,
145 % \texttenge,
146 % \textruble
147 % }
148 % The font has common currency characters, like \cs{textdollar}
149 % (\textdollar), \cs{textyen} (\textyen), \cs{textsterling}
150 % (\textsterling), \cs{texteuro} (\texteuro). It also defines several
151 % less common currency characters:
152 % \cs{texthryvnia} (\texthryvnia),
153 % \cs{texttugrik} (\texttugrik),
154 % \cs{texttenge} (\texttenge),
155 % \cs{textruble} (\textruble).
156 % \end{function}
157 %
158 % \begin{function}{
159 % \textaldine,
160 % \textsmilewhite,
161 % \textsmileblack
162 % }
163 % The font has \cs{textnumero} sign: \textnumero. It also defines some
164 % less common characters:
165 % \cs{textaldine} (\textaldine),
166 % \cs{textsmilewhite} (\textsmilewhite)
167 % \cs{textsmileblack} (\textsmileblack).
168 % \end{function}
169 %
170 %
171 %
172 % \end{documentation}
173 % \clearpage
174 %
175 % \begin{implementation}
176 %
177 % \section{Implementation}
178 % \label{sec:impl}
179 %
180 %
181 %
182 %\subsection{Setting up}
183 %\label{sec:settingup}
184 %
185 %
186 %
187 % First, we declare who we are:
188 % \begin{macrocode}
189 %<@@=arsenal>
190 %<*package>
191 \ProvidesExplPackage {arsenal}
192 {2025-12-13} {v1.1}
193 {Arsenal font by Andrij Shevchenko}
194 % \end{macrocode}
195 %
196 %
197 %\subsection{Options}
198 %\label{sec:options}
199 %
200 % \begin{variable}{
201 % default,
202 % sfdefault,
203 % math,
204 % scale,
205 % Scale,
206 % \l_@@_default_bool,
207 % \l_@@_sfdefault_bool,
208 % \l_@@_math_tl,
209 % \l_@@_scale_tl,
210 % }
211 % \changes{v1.0}{2025/10/13}{Made math option pseudoboolean}
212 % We cannot define |math| to set a boolean, since we want to process the
213 % case when it is not set and look at the default options and also
214 % process obsolete options as well. Thus this option sets a token
215 % list, which happens to contain |true| and |false|.
216 % \begin{macrocode}
217 \tl_new:N \l_@@_math_tl
218 \keys_define:nn {arsenal}
219 {
220 default .bool_set:N = \l_@@_default_bool,
221 default .default:n = true,
222 sfdefault .bool_set:N = \l_@@_sfdefault_bool,
223 sfdefault .default:n = true,
224 math .choices:nn = {true, false, none, arsenal+kpsans, kpsans, iwona}
225 {\tl_set_eq:NN \l_@@_math_tl \l_keys_choice_tl },
226 scale .tl_set:N = \l_@@_scale_tl,
227 Scale .tl_set:N = \l_@@_scale_tl,
228 }
229 \keys_set:nn { arsenal }
230 {
231 default=true,
232 sfdefault = false,
233 scale = 0.89,
234 }
235 \tl_clear:N \l_@@_math_tl
236 % \end{macrocode}
237 % \end{variable}
238 %
239 % Processing options
240 % \begin{macrocode}
241 \IfFormatAtLeastTF { 2022-06-01 }
242 { \ProcessKeyOptions [ arsenal ] }
243 {
244 \RequirePackage { l3keys2e }
245 \ProcessKeysOptions { arsenal }
246 }
247 % \end{macrocode}
248 % And setting up math
249 % \begin{macrocode}
250 \tl_if_empty:NT \l_@@_math_tl
251 {
252 \bool_if:NTF \l_@@_default_bool
253 {
254 \tl_set:Nn \l_@@_math_tl {true}
255 }
256 {
257 \tl_set:Nn \l_@@_math_tl {false}
258 }
259 }
260 % \end{macrocode}
261 %
262 %
263 %\subsection{Setting up font}
264 %\label{sec:font}
265 %
266 % \begin{macrocode}
267 \RequirePackage{fontspec}
268 \newfontfamily\arsenalfamily{Arsenal-Regular.otf}
269 [
270 NFSSFamily=arsenal,
271 Ligatures=TeX,
272 Scale=\l_@@_scale_tl,
273 ItalicFont = Arsenal-Italic.otf,
274 BoldFont = Arsenal-Bold.otf,
275 BoldItalicFont = Arsenal-BoldItalic.otf,
276 SwashFont = Arsenal-Regular.otf,
277 SwashFeatures={Style=Swash},
278 BoldSwashFont = Arsenal-Bold.otf,
279 BoldSwashFeatures={Style=Swash},
280 FontFace = {m}{itsw}{Font = Arsenal-Italic.otf, Style=Swash},
281 FontFace = {b}{itsw}{Font = Arsenal-BoldItalic.otf, Style=Swash},
282 ]
283 % \end{macrocode}
284 %
285 % Checking whether we want the font to be default
286 % \begin{macrocode}
287 \bool_if:NT \l_@@_default_bool
288 {
289 \renewcommand\rmdefault{arsenal}
290 }
291
292 \bool_if:NT \l_@@_sfdefault_bool
293 {
294 \renewcommand\sfdefault{arsenal}
295 }
296 % \end{macrocode}
297 %
298 % \begin{macro}{\textarsenal}
299 % \begin{macrocode}
300 \DeclareTextFontCommand{\textarsenal}{\arsenalfamily}
301 % \end{macrocode}
302 % \end{macro}
303 %
304 % Swash changing rules
305 % \begin{macrocode}
306 \DeclareFontShapeChangeRule {sw}{it} {itsw} {it}
307 \DeclareFontShapeChangeRule {it}{sw} {itsw} {sw}
308 % \end{macrocode}
309 %
310 % Special characters, absent in the default
311 % \begin{macro}{
312 % \texthryvnia,
313 % \texttugrik,
314 % \texttenge,
315 % \textruble
316 % }
317 % Currency symbols
318 % \begin{macrocode}
319 \DeclareUnicodeSymbol{\texthryvnia} {"20B4}
320 \DeclareUnicodeSymbol{\texttugrik} {"20AE}
321 \DeclareUnicodeSymbol{\texttenge} {"20B8}
322 \DeclareUnicodeSymbol{\textruble} {"20BD}
323 % \end{macrocode}
324 %
325 % \end{macro}
326 %
327 % \begin{macro}{
328 % \textaldine,
329 % \textsmilewhite,
330 % \textsmileblack
331 % }
332 % Other symbols
333 % \begin{macrocode}
334 \DeclareUnicodeSymbol{\textaldine} {"2767}
335 \DeclareUnicodeSymbol{\textsmilewhite} {"263A}
336 \DeclareUnicodeSymbol{\textsmileblack} {"263B}
337 % \end{macrocode}
338 % \end{macro}
339 %
340 %
341 %\subsection{Math}
342 %\label{sec:math}
343 %
344 % Obsolete options produce a warning
345 % \begin{macrocode}
346 \tl_if_eq:NnT \l_@@_math_tl {iwona}
347 {
348 \ClassWarningNoLine{arsenal}{Option~math=iwona ~ is~obsolete.~
349 Switching~to~the~native~Arsenal~math}
350 \tl_set:Nn \l_@@_math_tl {true}
351 }
352 \tl_if_eq:NnT \l_@@_math_tl {kpsans}
353 {
354 \ClassWarningNoLine{arsenal}{Option~math=kpsans ~ is~obsolete.~
355 Switching~to~the~native~Arsenal~math}
356 \tl_set:Nn \l_@@_math_tl {true}
357 }
358 \tl_if_eq:NnT \l_@@_math_tl {arsenal+kpsans}
359 {
360 \ClassWarningNoLine{arsenal}{Option~math=arsenal+kpsans ~ is~obsolete.~
361 Switching~to~the~native~Arsenal~math}
362 \tl_set:Nn \l_@@_math_tl {true}
363 }
364 % \end{macrocode}
365 %
366 % We use Arsenal Math:
367 % \changes{v1.1}{2025/12/13}{Switched to arsenal-math defaults}
368 % \changes{v1.1}{2025/12/13}{Calligraphic font uses swash}
369 % \begin{macrocode}
370 \tl_if_eq:NnT \l_@@_math_tl {true}
371 {
372 \RequirePackage[Scale=\l_@@_scale_tl]{arsenal-math}
373 \setmathfont{ArsenalMath-Sans}[
374 BoldFont=ArsenalMath-SansBold,
375 StylisticSet=1,
376 range={cal, bfcal}]
377 }
378
379 % \end{macrocode}
380 %
381 % \begin{macrocode}
382 %</package>
383 % \end{macrocode}
384 % \end{implementation}
385 %
386 % \bibliography{arsenal}
387 % \bibliographystyle{plainnat}
388 %
389 %
390 % \PrintIndex
391 % \PrintChanges