<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">%% $Id: bonum-otf.sty 925 2024-07-23 17:47:45Z 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.
%%
%
\ProvidesPackage{bonum-otf}[%
  2024/07/23 v. 0.01 (Herbert Voss) Supports TeX Gyre bonum fonts for lualatex and xelatex.] 

\RequirePackage{iftex,xkeyval,textcomp}

\newif\ifbonum@lining \bonum@liningtrue
\newif\ifbonum@tabular \bonum@tabulartrue
\newif\ifbonum@usefilenames \bonum@usefilenamestrue
\newif\ifbonum@nomath \bonum@nomathfalse
\newif\ifbonum@libertinus \bonum@libertinusfalse

\DeclareOptionX{lining}[true]{\@nameuse{bonum@lining#1}}
\DeclareOptionX{nf}[true]{\@nameuse{bonum@lining#1}}
\DeclareOptionX{lf}[true]{\@nameuse{bonum@lining#1}}
\DeclareOptionX{oldstyle}[true]{\@nameuse{if#1}\bonum@liningfalse\else\bonum@liningtrue\fi}
\DeclareOptionX{osf}[true]{\@nameuse{if#1}\bonum@liningfalse\else\bonum@liningtrue\fi}
\DeclareOptionX{libertinus}[true]{\@nameuse{bonum@libertinus#1}}

\newcommand*\bonumMM@feature{}
\DeclareOptionX{math}[]{\renewcommand*\bonumMM@feature{#1}}
\DeclareOptionX{nomath}[true]{\@nameuse{bonum@nomath#1}}

\DeclareOptionX{usefilenames}[true]{\@nameuse{bonum@usefilenames#1}}

\DeclareOptionX{tabular}[true]{\@nameuse{bonum@tabular#1}}
\DeclareOptionX{t}[true]{\@nameuse{bonum@tabular#1}}
\DeclareOptionX{proportional}[true]{\@nameuse{if#1}\bonum@tabularfalse\else\bonum@tabulartrue\fi}
\DeclareOptionX{p}[true]{\@nameuse{if#1}\bonum@tabularfalse\else\bonum@tabulartrue\fi}

\newcommand*\bonumRM@scale{1}  
\DeclareOptionX{ScaleRM}{\renewcommand*{\bonumRM@scale}{#1}}

\def\bonum@defaultfeatures{}
\DeclareOptionX{defaultfeatures}{\def\bonum@defaultfeatures{#1}}

\ProcessOptionsX\relax

\RequirePackage{unicode-math}

\ifbonum@lining
    \def\bonum@figurestyle{+lnum}
\else
    \def\bonum@figurestyle{+onum}
\fi

\ifbonum@tabular
    \def\bonum@figurealign{+tnum} 
\else
    \def\bonum@figurealign{+pnum} 
\fi

\ifxetex\XeTeXtracingfonts=1\fi
\defaultfontfeatures[\rmfamily,\sffamily]{
     Ligatures = TeX ,
     SmallCapsFeatures={Letters=SmallCaps},%       \ifluatex,Renderer=Basic\fi}, 
     \bonum@defaultfeatures
}

\ifbonum@usefilenames
%------------------------   filenames start -------------------------

%texgyrebonum-bold.otf		texgyrebonum-italic.otf
%texgyrebonum-bolditalic.otf	texgyrebonum-regular.otf


\setmainfont{texgyrebonum}[ 
  RawFeature     = {\bonum@figurealign;\bonum@figurestyle},
  Scale          = \bonumRM@scale ,
  UprightFont    = *-regular,
  ItalicFont     = *-italic,
  ItalicFeatures = { SmallCapsFont = *-italic },
  SlantedFont    = *-regular,
  SlantedFeatures= {FakeSlant=0.2},
  BoldFont       = *-bold,
  BoldFeatures   = { SmallCapsFont = *-bold },
  BoldItalicFont = *-bolditalic,
  BoldItalicFeatures = { SmallCapsFont = *-bolditalic },
  BoldSlantedFont= *-bold,
  BoldSlantedFeatures= {FakeSlant=0.2, SmallCapsFont = *-bold },
  SmallCapsFont  = *-regular,
%  SmallCapsFeatures={RawFeature=+smcp},
  SmallCapsFeatures={Letters=SmallCaps}, 
  Extension      = .otf  
]

\newfontfamily\bonum{texgyrebonum}[ 
  RawFeature     = {\bonum@figurealign;\bonum@figurestyle},
  Scale          = \bonumRM@scale ,
  UprightFont    = *-regular,
  ItalicFont     = *-italic,
  ItalicFeatures = { SmallCapsFont = *-italic },
  SlantedFont    = *-regular,
  SlantedFeatures= {FakeSlant=0.2},
  BoldFont       = *-bold,
  BoldFeatures   = { SmallCapsFont = *-bold },
  BoldItalicFont = *-bolditalic,
  BoldItalicFeatures = { SmallCapsFont = *-bolditalic },
  BoldSlantedFont= *-bold,
  BoldSlantedFeatures= {FakeSlant=0.2, SmallCapsFont = *-bold },
  SmallCapsFont  = *-regular,
%  SmallCapsFeatures={RawFeature=+smcp},
  SmallCapsFeatures={Letters=SmallCaps}, 
  Extension      = .otf  
]

\newfontfamily\bonumOsF{texgyrebonum}[
  RawFeature     = {+onum},
  Scale          = \bonumRM@scale ,
  UprightFont    = *-regular,
  ItalicFont     = *-italic,
  ItalicFeatures = { SmallCapsFont = *-italic },
  SlantedFont    = *-regular,
  SlantedFeatures= {FakeSlant=0.2},
  BoldFont       = *-bold,
  BoldFeatures   = { SmallCapsFont = *-bold },
  BoldItalicFont = *-bolditalic,
  BoldItalicFeatures = { SmallCapsFont = *-bolditalic },
  BoldSlantedFont= *-bold,
  BoldSlantedFeatures= {FakeSlant=0.2, SmallCapsFont = *-bold },
  SmallCapsFont  = *-regular,
%  SmallCapsFeatures={RawFeature=+smcp},
  SmallCapsFeatures={Letters=SmallCaps}, 
  Extension      = .otf  
]

\newfontfamily\bonumTLF{texgyrebonum}[
  RawFeature        = {+tnum;-onum},
  Scale          = \bonumRM@scale ,
  UprightFont    = *-regular,
  ItalicFont     = *-italic,
  ItalicFeatures = { SmallCapsFont = *-italic },
  SlantedFont    = *-regular,
  SlantedFeatures= {FakeSlant=0.2},
  BoldFont       = *-bold,
  BoldFeatures   = { SmallCapsFont = *-bold },
  BoldItalicFont = *-bolditalic,
  BoldItalicFeatures = { SmallCapsFont = *-bolditalic },
  BoldSlantedFont= *-bold,
  BoldSlantedFeatures= {FakeSlant=0.2, SmallCapsFont = *-bold },
  SmallCapsFont  = *-regular,
%  SmallCapsFeatures={RawFeature=+smcp},
  SmallCapsFeatures={Letters=SmallCaps}, 
  Extension      = .otf  
]
%------------------------   filenames stop -------------------------
\else
%------------------------   symbolic names start -------------------------
\setmainfont{TeX Gyre bonum}[ 
  RawFeature        = {\bonum@figurealign,\bonum@figurestyle},
  Scale             = \bonumRM@scale ,
  UprightFont       = * Regular,
  SlantedFont       = * Regular,
  SlantedFeatures   = {FakeSlant=0.2},
  ItalicFont        = * Italic,
  ItalicFeatures    = { SmallCapsFont = * Italic },
  BoldFont          = * Bold, 
  BoldFeatures      = { SmallCapsFont = * Bold },
  BoldItalicFont    = * Bold Italic,
  BoldItalicFeatures= { SmallCapsFont = * Bold Italic },
  SmallCapsFont     = * Regular,
  SmallCapsFeatures = {RawFeature=+smcp},
  BoldSlantedFont   = * Bold,
  BoldSlantedFeatures = {FakeSlant=0.2, SmallCapsFont = * Bold },
  SmallCapsFeatures  = {Letters=SmallCaps}, 
]
\newfontfamily\bonum{TeX Gyre bonum}[
  RawFeature        = {\bonum@figurealign,\bonum@figurestyle},
  Scale             = \bonumRM@scale ,
  UprightFont       = * Regular,
  SlantedFont       = * Regular,
  SlantedFeatures   = {FakeSlant=0.2},
  ItalicFont        = * Italic,
  ItalicFeatures    = { SmallCapsFont = * Italic },
  BoldFont          = * Bold, 
  BoldFeatures      = { SmallCapsFont = * Bold },
  BoldItalicFont    = * Bold Italic,
  BoldItalicFeatures= { SmallCapsFont = * Bold Italic },
  SmallCapsFont     = * Regular,
  SmallCapsFeatures = {RawFeature=+smcp},
  BoldSlantedFont   = * Bold,
  BoldSlantedFeatures = {FakeSlant=0.2, SmallCapsFont = * Bold },
  SmallCapsFeatures  = {Letters=SmallCaps}, 
]
\newfontfamily\bonumOsF{TeX Gyre bonum}[
  RawFeature        = {OldStyle,Proportional},
  Scale             = \bonumRM@scale ,
  UprightFont       = * Regular,
  SlantedFont       = * Regular,
  SlantedFeatures   = {FakeSlant=0.2},
  ItalicFont        = * Italic,
  ItalicFeatures    = { SmallCapsFont = * Italic },
  BoldFont          = * Bold, 
  BoldFeatures      = { SmallCapsFont = * Bold },
  BoldItalicFont    = * Bold Italic,
  BoldItalicFeatures= { SmallCapsFont = * Bold Italic },
  SmallCapsFont     = * Regular,
  SmallCapsFeatures = {RawFeature=+smcp},
  BoldSlantedFont   = * Bold,
  BoldSlantedFeatures = {FakeSlant=0.2, SmallCapsFont = * Bold },
  SmallCapsFeatures  = {Letters=SmallCaps}, 
]

\newfontfamily\bonumTLF{TeX Gyre bonum}[
  RawFeature        = {Lining,Monospaced},
  Scale             = \bonumRM@scale ,
  UprightFont       = * Regular,
  SlantedFont       = * Regular,
  SlantedFeatures   = {FakeSlant=0.2},
  ItalicFont        = * Italic,
  ItalicFeatures    = { SmallCapsFont = * Italic },
  BoldFont          = * Bold, 
  BoldFeatures      = { SmallCapsFont = * Bold },
  BoldItalicFont    = * Bold Italic,
  BoldItalicFeatures= { SmallCapsFont = * Bold Italic },
  SmallCapsFont     = * Regular,
  SmallCapsFeatures = {RawFeature=+smcp},
  BoldSlantedFont   = * Bold,
  BoldSlantedFeatures = {FakeSlant=0.2, SmallCapsFont = * Bold },
  SmallCapsFeatures  = {Letters=SmallCaps}, 
]

\fi
%------------------------   symbolic names stop -------------------------

\ifbonum@nomath\else
  \typeout{*************************************^^J%
           * Using bonum math              *^^J%
           *************************************}%
  \setmathfont{texgyrebonum-math.otf}[AutoFakeBold,RawFeature=\bonumMM@feature]
  \ifbonum@libertinus
    \setmathfont{LibertinusMath-Regular.otf}[AutoFakeBold,RawFeature=\bonumMM@feature,
    	range={\int,\iint,\iiint,\iiiint,\oint,\oiint,\oiiint}]
  \fi	
\fi

\def\sufigures{\addfontfeatures{VerticalPosition=Superior}}
\DeclareTextFontCommand{\textsup}{\sufigures}
\DeclareTextFontCommand{\textinit}{\bonumInitials}%  Initials

\def\Lsup#1{{\addfontfeature{RawFeature=+sups}#1}}
\def\Lsinf#1{{\addfontfeature{RawFeature=+sinf}#1}}
\def\Land{{\addfontfeature{RawFeature=+ss06}\&amp;}}

\def\Lcase#1{{\addfontfeature{RawFeature=case}#1}}
\def\LCASE{\@ifnextchar-\L@CASE\L@@CASE}
\def\L@CASE-{\addfontfeature{RawFeature=-case}}
\def\L@@CASE#1{\addfontfeature{RawFeature=+case}\ifx#1+\else#1\fi}

\def\Lfrac#1{{\addfontfeature{RawFeature=+frac}#1}}
\def\LFRAC{\@ifnextchar-\L@FRAC\L@@FRAC}
\def\L@FRAC-{\addfontfeature{RawFeature=-frac}}
\def\L@@FRAC#1{\addfontfeature{RawFeature=+frac}\ifx#1+\else#1\fi}

\def\Lcpsp#1{{\addfontfeature{RawFeature=+cpsp}#1}}
\def\LCPSP{\@ifnextchar-\L@CPSP\L@@CPSP}
\def\L@CPSP-{\addfontfeature{RawFeature=-cpsp}}
\def\L@@CPSP#1{\addfontfeature{RawFeature=+cpsp}\ifx#1+\else#1\fi}

\def\Lss#1#2#3{{\addfontfeature{RawFeature=+ss#1#2}#3}}
\def\LSS#1#2{\addfontfeature{RawFeature=+ss#1#2}}

\def\Lctosc#1{{\addfontfeature{RawFeature=+c2sc}#1}}
\def\LCtoSC{\@ifnextchar-\L@CtoSC\L@@CtoSC}
\def\L@CtoSC-{\addfontfeature{RawFeature=-c2sc}}
\def\L@@CtoSC#1{\addfontfeature{RawFeature=+c2sc}\ifx#1+\else#1\fi}

\def\Lctosmcp#1{{\addfontfeature{RawFeature={+c2sc,+smcp}}#1}}
\def\LCtoSMCP{\@ifnextchar-\L@CtoSMCP\L@@CtoSMCP}
\def\L@CtoSMCP-{\addfontfeature{RawFeature={-c2sc,-smcp}}}
\def\L@@CtoSMCP#1{\addfontfeature{RawFeature={+c2sc,+smcp}}\ifx#1+\else#1\fi}

\def\Lsalt#1{{\addfontfeature{RawFeature=+salt}#1}}
\def\LSALT{\@ifnextchar-\L@SALT\L@@SALT}
\def\L@SALT-{\addfontfeature{RawFeature=-salt}}
\def\L@@SALT#1{\addfontfeature{RawFeature=+salt}\ifx#1+\else#1\fi}

\def\Lliga#1{{\addfontfeature{RawFeature=+liga}#1}}
\def\LLIGA{\@ifnextchar-\L@LIGA\L@@LIGA}
\def\L@LIGA-{\addfontfeature{RawFeature=-liga}}
\def\L@@LIGA#1{\addfontfeature{RawFeature=+liga}\ifx#1+\else#1\fi}


\def\Lhlig#1{{\addfontfeature{RawFeature=+hlig}#1}}
\def\LHLIG{\@ifnextchar-\L@HLIG\L@@HLIG}
\def\L@HLIG-{\addfontfeature{RawFeature=-hlig}}
\def\L@@HLIG#1{\addfontfeature{RawFeature=+hlig}\ifx#1+\else#1\fi}

\def\Ldlig#1{{\addfontfeature{RawFeature=+dlig}#1}}
\def\LDLIG{\@ifnextchar-\L@DLIG\L@@DLIG}
\def\L@DLIG-{\addfontfeature{RawFeature=-dlig}}
\def\L@@DLIG#1{\addfontfeature{RawFeature=+dlig}\ifx#1+\else#1\fi}

\endinput

</pre></body></html>