diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/firamath-otf/firamath-otf.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/firamath-otf/firamath-otf.sty | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/firamath-otf/firamath-otf.sty b/Master/texmf-dist/tex/latex/firamath-otf/firamath-otf.sty new file mode 100644 index 00000000000..e066ad4a89d --- /dev/null +++ b/Master/texmf-dist/tex/latex/firamath-otf/firamath-otf.sty @@ -0,0 +1,79 @@ +%% $Id: firamath-otf.sty 808 2018-09-17 06:52:53Z herbert $ +%% +%% This file is distributed under the terms of the LaTeX Project Public +%% License from CTAN archives in directory macros/latex/base/lppl.txt. +%% Either version 1.3 or, at your option, any later version. +%% +% +% Copyright 2018 Herbert Voss hvoss@tug.org +% +\ProvidesPackage{firamath-otf}[% + 2018/09/17 v. 0.01 (Herbert Voss) Supports fira math fonts for all luatex/xetex .] + +\RequirePackage{ifxetex,ifluatex,xkeyval,textcomp} +\RequirePackage{unicode-math} + +\newif\iffiramath@fakebold \firamath@fakeboldfalse +\newif\iffiramath@lining \firamath@liningtrue +\newif\iffiramath@tabular \firamath@tabulartrue +\newif\iffiramath@usefilenames \firamath@usefilenamesfalse + +\DeclareOptionX{fakebold}[true]{\@nameuse{firamath@fakebold#1}} +\DeclareOptionX{weight}[Regular]{\def\fira@weight{#1}} +\DeclareOptionX{lining}[true]{\@nameuse{firamath@lining#1}} +\DeclareOptionX{nf}[true]{\@nameuse{firamath@lining#1}} +\DeclareOptionX{lf}[true]{\@nameuse{firamath@lining#1}} +\DeclareOptionX{oldstyle}[true]{\@nameuse{if#1}\firamath@liningfalse\else\firamath@liningtrue\fi} +\DeclareOptionX{osf}[true]{\@nameuse{if#1}\firamath@liningfalse\else\firamath@liningtrue\fi} + +\DeclareOptionX{usefilenames}[true]{\@nameuse{firamath@usefilenames#1}} +\DeclareOptionX{nomath}[true]{\@nameuse{firamath@nomath#1}} + +\DeclareOptionX{tabular}[true]{\@nameuse{firamath@tabular#1}} +\DeclareOptionX{t}[true]{\@nameuse{firamath@tabular#1}} +\DeclareOptionX{proportional}[true]{\@nameuse{if#1}\firamath@tabularfalse\else\firamath@tabulartrue\fi} +\DeclareOptionX{p}[true]{\@nameuse{if#1}\firamath@tabularfalse\else\firamath@tabulartrue\fi} + +\newcommand*\firamath@scale{1} +\DeclareOptionX{Scale}{\renewcommand*{\firamath@scale}{#1}} + +\def\firamath@defaultfeatures{} +\DeclareOptionX{defaultfeatures}{\def\firamath@defaultfeatures{#1}} + +\ProcessOptionsX\relax + +\iffiramath@fakebold\RequirePackage{xfakebold}\fi +\iffiramath@lining + \def\firamath@figurestyle{Lining} +\else + \def\firamath@figurestyle{OldStyle} +\fi + +\iffiramath@tabular + \def\firamath@figurealign{Monospaced} +\else + \def\firamath@figurealign{Proportional} +\fi + +\ifxetex\XeTeXtracingfonts=1\fi +\defaultfontfeatures{\firamath@defaultfeatures} + +\iffiramath@usefilenames + \setmathfont{FiraMath-\fira@weight.otf}[ + Scale=\firamath@scale, + Numbers={\firamath@figurestyle,\firamath@figurealign}, +% BoldFont=FiraMath-Medium.otf + ] + \setmathfont[version=pnum,Numbers=Proportional,Scale=\firamath@scale]{FiraMath-Regular.otf} + +\else + \setmathfont{Fira Math Regular}[ + Scale=\firamath@scale, + Numbers={\firamath@figurestyle,\firamath@figurealign}, +% BoldFont=Fira Math Medium + ] + \setmathfont[version=pnum,Numbers=Proportional,Scale=\firamath@scale]{Fira Math Regular} +\fi + + +\endinput
\ No newline at end of file |