summaryrefslogtreecommitdiff
path: root/fonts/arimo/latex/arimo.sty
blob: aa1ee63f97d80014de6e9a39ecd5d466e5566cb9 (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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{arimo}
    [2017/01/05 (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
  \ifxetex\XeTeXtracingfonts=1\fi
  \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