summaryrefslogtreecommitdiff
path: root/fonts/theanomodern/latex/TheanoModern.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /fonts/theanomodern/latex/TheanoModern.sty
Initial commit
Diffstat (limited to 'fonts/theanomodern/latex/TheanoModern.sty')
-rw-r--r--fonts/theanomodern/latex/TheanoModern.sty93
1 files changed, 93 insertions, 0 deletions
diff --git a/fonts/theanomodern/latex/TheanoModern.sty b/fonts/theanomodern/latex/TheanoModern.sty
new file mode 100644
index 0000000000..1432e20c46
--- /dev/null
+++ b/fonts/theanomodern/latex/TheanoModern.sty
@@ -0,0 +1,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