summaryrefslogtreecommitdiff
path: root/fonts/arimo/latex/arimo.sty
blob: 0b5ca9de57ea1f248b7a135fdc160732f25afb9f (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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{arimo}
    [2022/09/28 (Bob Tennent)  Supports Arimo fonts for all LaTeX engines.]

\RequirePackage{ifxetex,ifluatex,xkeyval,textcomp}

\newif\ifarimo@ttf 
\ifxetex
  \arimo@ttftrue
\else\ifluatex
  \arimo@ttftrue
\else  % [pdf]LaTeX
  \arimo@ttffalse
\fi\fi

\newif\ifarimo@default \arimo@defaultfalse

\newcommand*{\Arimo@scale}{1}
\DeclareOptionX{scaled}{\renewcommand*{\Arimo@scale}{#1}}
\DeclareOptionX{scale}{\renewcommand*{\Arimo@scale}{#1}}

\DeclareOptionX{sfdefault}{\arimo@defaulttrue}
\DeclareOptionX{type1}{\arimo@ttffalse}

\ProcessOptionsX\relax

\ifarimo@ttf
  \RequirePackage{fontspec}
\else
  \RequirePackage{fontenc,fontaxes}
\fi

\ifarimo@ttf
  \defaultfontfeatures{
        Ligatures = TeX ,
        Scale     = \Arimo@scale ,
        Extension = .ttf }
  \setsansfont
      [ UprightFont    = *-Regular ,
        ItalicFont     = *-Italic ,
        BoldFont       = *-Bold , 
        BoldItalicFont = *-BoldItalic ]
      {Arimo}
  % grab current family in case of subsequent change:
  \let\arimofamily\sfdefault  
  \ifarimo@default\renewcommand*\familydefault{\arimofamily}\fi
  \newfontfamily\arimo
      [ UprightFont    = *-Regular ,
        ItalicFont     = *-Italic ,
        BoldFont       = *-Bold , 
        BoldItalicFont = *-BoldItalic ]
      {Arimo}
\else % type1
  \def\arimofamily{Arimo-TLF}
  \newcommand*\arimo{\fontfamily{\arimofamily}\selectfont}
  \def\sfdefault{\arimofamily}
  \ifarimo@default\edef\familydefault{\sfdefault}\fi
\fi

\ifarimo@ttf
% turn off defaults in case other fonts are selected:
  \defaultfontfeatures{}
\fi

\endinput