summaryrefslogtreecommitdiff
path: root/fonts/oldstandard/latex/OldStandard.sty
blob: 0ced47514e3534f94eba6185a7b986f8365d2ea1 (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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{OldStandard}
    [2020/02/24 (Bob Tennent and autoinst)  Style file for Old Standard fonts.]

\RequirePackage{ifxetex,ifluatex,xkeyval,textcomp}

\newif\ifoldstandard@otf 
\ifxetex
  \oldstandard@otftrue
\else\ifluatex
  \oldstandard@otftrue
\else  % [pdf]LaTeX
  \oldstandard@otffalse
 \fi\fi  
  
\RequirePackage{fontaxes}

\newcommand*{\OldStandard@scale}{1}
\RequirePackage{xkeyval}
\DeclareOptionX{scaled}{\renewcommand*{\OldStandard@scale}{#1}}
\DeclareOptionX{scale}{\renewcommand*{\OldStandard@scale}{#1}}
\DeclareOptionX{type1}{\oldstandard@otffalse}

\ProcessOptionsX\relax

\ifoldstandard@otf
  \RequirePackage{fontspec}
\else
  \RequirePackage{fontenc,fontaxes}
\fi

\ifoldstandard@otf
  \ifxetex\XeTeXtracingfonts=1\fi
  \defaultfontfeatures{
        Ligatures = TeX ,
        Scale     = \OldStandard@scale ,
        Extension = .otf }
  \setmainfont
      [ UprightFont    = *-Regular ,
        ItalicFont     = *-Italic ,
        BoldFont    = *-Bold ,
        BoldItalicFont    = *-BoldItalic ,
      ]
      {OldStandard}
  \newfontfamily\oldstandard
      [ UprightFont    = *-Regular ,
        ItalicFont     = *-Italic ,
        BoldFont    = *-Bold ,
        BoldItalicFont    = *-BoldItalic ,
      ]
      {OldStandard}

  \providecommand\sufigures{\addfontfeatures{VerticalPosition=Superior}}  


\else % type1

  \def\oldstandard@family{OldStandard-TLF}
  \renewcommand*\rmdefault{\oldstandard@family}
  \newcommand*\oldstandard{\fontfamily{\oldstandard@family}\selectfont}

  \fa@naming@exception{figures}{{superior}{proportional}}{Sup}
  \fa@naming@exception{figures}{{superior}{tabular}}{Sup}
  \providecommand\sufigures{\@nomath\sufigures\fontfigurestyle{superior}\selectfont}

\fi

\DeclareTextFontCommand{\textsu}{\sufigures}

\def\oldstandardlgr{\fontencoding{LGR}\fontfamily{OldStandard-TLF}\selectfont}

\ifoldstandard@otf
  \defaultfontfeatures{}
\fi

\endinput