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/bitter/latex/bitter.sty |
Initial commit
Diffstat (limited to 'fonts/bitter/latex/bitter.sty')
-rw-r--r-- | fonts/bitter/latex/bitter.sty | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/fonts/bitter/latex/bitter.sty b/fonts/bitter/latex/bitter.sty new file mode 100644 index 0000000000..1362c92640 --- /dev/null +++ b/fonts/bitter/latex/bitter.sty @@ -0,0 +1,72 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{bitter} + [2019/05/10 (R.D. Tennent) Supports Bitter fonts for all LaTeX engines.] + +\RequirePackage{ifxetex,ifluatex,textcomp} + +\newif\ifBitter@ttf +\ifxetex + \Bitter@ttftrue +\else\ifluatex + \Bitter@ttftrue +\else % [pdf]LaTeX + \Bitter@ttffalse +\fi\fi + +\newcommand*{\Bitter@scale}{1} +\RequirePackage{xkeyval} +\DeclareOptionX{scaled}{\renewcommand*{\Bitter@scale}{#1}} +\DeclareOptionX{scale}{\renewcommand*{\Bitter@scale}{#1}} + +\DeclareOptionX{type1}{\Bitter@ttffalse} + +\ProcessOptionsX\relax + +\ifBitter@ttf + \RequirePackage{fontspec} +\else + \RequirePackage{fontenc,fontaxes,mweights} +\fi + +\ifBitter@ttf + \def\Bitter@regular{Regular} + \ifxetex\XeTeXtracingfonts=1\fi + \defaultfontfeatures{ + Ligatures = TeX , + Extension = .ttf , + Scale = \Bitter@scale , + } + \setmainfont + [ UprightFont = *-Regular , + ItalicFont = *-Italic , + BoldFont = *-Bold , + ] + {Bitter} + % grab current family in case of subsequent change: + \let\Bitterfamily\rmdefault + + \newfontfamily\bitter + [ UprightFont = *-Regular , + ItalicFont = *-Italic , + BoldFont = *-Bold , + ] + {Bitter} + +\else % type1 + + \def\bfseries@rm{b} + \def\mdseries@rm{m} + \def\seriesdefault{\mdseries@rm} + \def\bitterfamily{Bitter-TLF} + \def\bitter{\fontfamily{\bitterfamily}\selectfont} + \def\rmdefault{\bitterfamily} + +\fi + +% turn off defaults in case other fonts are selected: +\ifBitter@ttf + \defaultfontfeatures{} +\fi + +\endinput + |