summaryrefslogtreecommitdiff
path: root/fonts/theanomodern/latex/TheanoModern.sty
blob: 1432e20c46807f1a051d2a19efb2dc31d16427d1 (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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{TheanoModern}
    [2019/07/27 (Bob Tennent and autoinst)  Style file for Theano Modern fonts.]

\RequirePackage{ifxetex,ifluatex,xkeyval,textcomp}

\newif\iftheanomodern@ttf 
\ifxetex
  \theanomodern@ttftrue
\else\ifluatex
  \theanomodern@ttftrue
\else  % [pdf]LaTeX
  \theanomodern@ttffalse
 \fi\fi  
  
\RequirePackage{fontaxes}

\newcommand*{\TheanoModern@scale}{1}
\RequirePackage{xkeyval}
\DeclareOptionX{scaled}{\renewcommand*{\TheanoModern@scale}{#1}}
\DeclareOptionX{scale}{\renewcommand*{\TheanoModern@scale}{#1}}
\DeclareOptionX{type1}{\theanomodern@ttffalse}

\newif\iftheanomodern@lining \theanomodern@liningtrue
\DeclareOptionX{osf}{\theanomodern@liningfalse}
\DeclareOptionX{oldstyle}{\theanomodern@liningfalse}

\ProcessOptionsX\relax

\iftheanomodern@ttf
  \RequirePackage{fontspec}
  \iftheanomodern@lining
     \def\theanomodern@figurealign{}
  \else
     \def\theanomodern@figurealign{OldStyle}
  \fi
\else
  \RequirePackage{fontenc,fontaxes}
  \iftheanomodern@lining
     \def\theanomodern@figurealign{LF}
  \else
     \def\theanomodern@figurealign{OsF}
  \fi
\fi

\iftheanomodern@ttf
  \ifxetex\XeTeXtracingfonts=1\fi
  \defaultfontfeatures{
        Ligatures = TeX ,
        Scale     = \TheanoModern@scale ,
        Extension = .ttf }
  \setmainfont
      [ Numbers={\theanomodern@figurealign},
        UprightFont    = *-Regular ,
        BoldFont    = *-Bold ,
      ]
      {TheanoModern}
  \newfontfamily\theanomodern
      [ Numbers={\theanomodern@figurealign},
        UprightFont    = *-Regular ,
        BoldFont    = *-Bold ,
      ]
      {TheanoModern}
  \newfontfamily\theanomodernosf
      [ Numbers={OldStyle},
        UprightFont    = *-Regular ,
        BoldFont    = *-Bold ,
      ]
      {TheanoModern}
  \newfontfamily\theanomodernlf
      [ Numbers={},
        UprightFont    = *-Regular ,
        BoldFont    = *-Bold ,
      ]
      {TheanoModern}

\else % type1

  \def\theanomodern@family{TheanoModern-T\theanomodern@figurealign}
  \renewcommand*\rmdefault{\theanomodern@family}
  \newcommand*\theanomodern{\fontfamily{\theanomodern@family}\selectfont}
  \newcommand*\theanomodernosf{\fontfamily{TheanoModern-TOsF}\selectfont}
  \newcommand*\theanomodernlf{\fontfamily{TheanoModern-TLF}\selectfont}

\fi

\def\theanomodernlgr{\fontencoding{LGR}\fontfamily{TheanoModern-TLF}\selectfont}

\iftheanomodern@ttf
  \defaultfontfeatures{}
\fi

\endinput