diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /fonts/firamath-otf/latex |
Initial commit
Diffstat (limited to 'fonts/firamath-otf/latex')
-rw-r--r-- | fonts/firamath-otf/latex/firamath-otf.sty | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/fonts/firamath-otf/latex/firamath-otf.sty b/fonts/firamath-otf/latex/firamath-otf.sty new file mode 100644 index 0000000000..ecc33046e8 --- /dev/null +++ b/fonts/firamath-otf/latex/firamath-otf.sty @@ -0,0 +1,81 @@ +%% $Id: firamath-otf.sty 1022 2019-04-03 12:00:29Z 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}[% + 2019/04/03 v. 0.02a (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 + +\def\fira@weight{Regular}% default + +\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 |