summaryrefslogtreecommitdiff
path: root/fonts/theanooldstyle/latex/TheanoOldStyle.sty
blob: 2756c5c84fc73123d3c63a5ee4df7e226e78b059 (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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{TheanoOldStyle}
    [2022/09/26 (Bob Tennent and autoinst)  Style file for Theano OldStyle fonts.]

\RequirePackage{ifxetex,ifluatex,xkeyval,textcomp}

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

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

\newif\iftheanooldstyle@lining \theanooldstyle@liningtrue
\DeclareOptionX{osf}{\theanooldstyle@liningfalse}
\DeclareOptionX{oldstyle}{\theanooldstyle@liningfalse}

\ProcessOptionsX\relax

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

\iftheanooldstyle@ttf
  \defaultfontfeatures{
        Ligatures = TeX ,
        Scale     = \TheanoOldStyle@scale ,
        Extension = .ttf }
  \setmainfont
      [ Numbers={\theanooldstyle@figurealign},
        UprightFont    = *-Regular ,
        BoldFont    = *-Bold ,
      ]
      {TheanoOldStyle}
  \newfontfamily\theanooldstyle
      [ Numbers={\theanooldstyle@figurealign},
        UprightFont    = *-Regular ,
        BoldFont    = *-Bold ,
      ]
      {TheanoOldStyle}
  \newfontfamily\theanooldstyleosf
      [ Numbers={OldStyle},
        UprightFont    = *-Regular ,
        BoldFont    = *-Bold ,
      ]
      {TheanoOldStyle}
  \newfontfamily\theanooldstylelf
      [ Numbers={},
        UprightFont    = *-Regular ,
        BoldFont    = *-Bold ,
      ]
      {TheanoOldStyle}

\else % type1

  \def\theanooldstyle@family{TheanoOldStyle-T\theanooldstyle@figurealign}
  \renewcommand*\rmdefault{\theanooldstyle@family}
  \newcommand*\theanooldstyle{\fontfamily{\theanooldstyle@family}\selectfont}
  \newcommand*\theanooldstyleosf{\fontfamily{TheanoOldStyle-TOsF}\selectfont}
  \newcommand*\theanooldstylelf{\fontfamily{TheanoOldStyle-TLF}\selectfont}

\fi

\def\theanooldstylelgr{\fontencoding{LGR}\fontfamily{TheanoOldStyle-TLF}\selectfont}

\iftheanooldstyle@ttf
  \defaultfontfeatures{}
\fi

\endinput