summaryrefslogtreecommitdiff
path: root/fonts/libertinus-otf/latex/libertinus-otf.sty
diff options
context:
space:
mode:
Diffstat (limited to 'fonts/libertinus-otf/latex/libertinus-otf.sty')
-rw-r--r--fonts/libertinus-otf/latex/libertinus-otf.sty284
1 files changed, 101 insertions, 183 deletions
diff --git a/fonts/libertinus-otf/latex/libertinus-otf.sty b/fonts/libertinus-otf/latex/libertinus-otf.sty
index e259070f14..f25ca02a91 100644
--- a/fonts/libertinus-otf/latex/libertinus-otf.sty
+++ b/fonts/libertinus-otf/latex/libertinus-otf.sty
@@ -1,14 +1,14 @@
-%% $Id: libertinus-otf.sty 710 2023-04-24 12:05:58Z herbert $
+%% $Id: libertinus-otf.sty 722 2023-05-17 16:52:17Z 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 2020 Herbert Voss hvoss@tug.org
+% Copyright 2023 Herbert Voss hvoss@tug.org
%
\ProvidesPackage{libertinus-otf}[%
- 2023/04/24 v. 0.30 (Herbert Voss) Supports libertinus fonts for lualatex and xelatex.]
+ 2023/05/16 v. 0.31 (Herbert Voss) Supports libertinus fonts for lualatex and xelatex.]
\RequirePackage{ifxetex,ifluatex,xkeyval,textcomp}
%\RequirePackage[no-math]{fontspec}
@@ -30,7 +30,8 @@
\newif\iflibertinus@lining \libertinus@liningtrue
\newif\iflibertinus@tabular \libertinus@tabulartrue
\newif\iflibertinus@semibold \libertinus@semiboldfalse
-\newif\iflibertinus@usefilenames \libertinus@usefilenamestrue
+\newif\iflibertinus@greek \libertinus@greekfalse
+\newif\iflibertinus@greekitalic \libertinus@greekitalicfalse
\DeclareOptionX{lining}[true]{\@nameuse{libertinus@lining#1}}
\DeclareOptionX{nf}[true]{\@nameuse{libertinus@lining#1}}
@@ -38,9 +39,14 @@
\DeclareOptionX{oldstyle}[true]{\@nameuse{if#1}\libertinus@liningfalse\else\libertinus@liningtrue\fi}
\DeclareOptionX{osf}[true]{\@nameuse{if#1}\libertinus@liningfalse\else\libertinus@liningtrue\fi}
-\DeclareOptionX{usefilenames}[true]{\@nameuse{libertinus@usefilenames#1}}
-\newcommand*\libertinusMM@feature{}
-\DeclareOptionX{math}[]{\renewcommand*\libertinusMM@feature{#1}}
+\providecommand*\libertinusUNI@feature{}
+\DeclareOptionX{uni}[]{\renewcommand*\libertinusUNI@feature{#1}}
+\providecommand*\libertinusMM@feature{}
+\DeclareOptionX{mathfeature}[]{\renewcommand*\libertinusMM@feature{#1}}
+\DeclareOptionX{greek}[true]{\@nameuse{libertinus@greek#1}}
+\DeclareOptionX{greekitalic}[true]{\@nameuse{libertinus@greekitalic#1}}
+
+
\DeclareOptionX{nomath}[true]{\@nameuse{libertinus@nomath#1}}
\DeclareOptionX{mono}[true]{\@nameuse{libertinus@mono#1}}
@@ -70,9 +76,94 @@
\ProcessOptionsX\relax
+\iflibertinus@greek
+ \RequirePackage{newunicodechar}
+\iftrue
+\newunicodechar{α}{\alpha}
+\newunicodechar{β}{\beta}
+\newunicodechar{γ}{\gamma}
+\newunicodechar{δ}{\delta}
+\newunicodechar{ε}{\varepsilon}
+\newunicodechar{ζ}{\zeta}
+\newunicodechar{η}{\eta}
+\newunicodechar{θ}{\theta}
+\newunicodechar{ι}{\iota}
+\newunicodechar{κ}{\kappa}
+\newunicodechar{λ}{\lambda}
+\newunicodechar{μ}{\mu}
+\newunicodechar{ν}{\nu}
+\newunicodechar{ξ}{\xi}
+\newunicodechar{ο}{\omicron}
+\newunicodechar{π}{\pi}
+\newunicodechar{ρ}{\rho}
+\newunicodechar{ς}{\varsigma}
+\newunicodechar{σ}{\sigma}
+\newunicodechar{τ}{\tau}
+\newunicodechar{υ}{\upsilon}
+\newunicodechar{φ}{\varphi}
+\newunicodechar{χ}{\chi}
+\newunicodechar{ψ}{\psi}
+\newunicodechar{ω}{\omega}
+\else
+\newunicodechar{α}{\mupalpha}
+\newunicodechar{β}{\mupbeta}
+\newunicodechar{γ}{\mupgamma}
+\newunicodechar{δ}{\mupdelta}
+\newunicodechar{ε}{\mupvarepsilon}
+\newunicodechar{ζ}{\mupzeta}
+\newunicodechar{η}{\mupeta}
+\newunicodechar{θ}{\muptheta}
+\newunicodechar{ι}{\mupiota}
+\newunicodechar{κ}{\mupkappa}
+\newunicodechar{λ}{\muplambda}
+\newunicodechar{μ}{\mupmu}
+\newunicodechar{ν}{\mupnu}
+\newunicodechar{ξ}{\mupxi}
+\newunicodechar{ο}{\mupomicron}
+\newunicodechar{π}{\muppi}
+\newunicodechar{ρ}{\muprho}
+\newunicodechar{ς}{\mupvarsigma}
+\newunicodechar{σ}{\mupsigma}
+\newunicodechar{τ}{\muptau}
+\newunicodechar{υ}{\mupupsilon}
+\newunicodechar{φ}{\mupvarphi}
+\newunicodechar{χ}{\mupchi}
+\newunicodechar{ψ}{\muppsi}
+\newunicodechar{ω}{\mupomega}
+\fi
+\iflibertinus@greekitalic
+ \RequirePackage{newunicodechar}%
+\newunicodechar{𝛼}{\mitalpha}
+\newunicodechar{𝛽}{\mitbeta}
+\newunicodechar{𝛾}{\mitgamma}
+\newunicodechar{𝛿}{\mitdelta}
+\newunicodechar{𝜀}{\mitvarepsilon}
+\newunicodechar{𝜁}{\mitzeta}
+\newunicodechar{𝜂}{\miteta}
+\newunicodechar{𝜃}{\mittheta}
+\newunicodechar{𝜄}{\mitiota}
+\newunicodechar{𝜅}{\mitkappa}
+\newunicodechar{𝜆}{\mitlambda}
+\newunicodechar{𝜇}{\mitmu}
+\newunicodechar{𝜈}{\mitnu}
+\newunicodechar{𝜉}{\mitxi}
+\newunicodechar{𝜊}{\mitomicron}
+\newunicodechar{𝜋}{\mitpi}
+\newunicodechar{𝜌}{\mitrho}
+\newunicodechar{𝜍}{\mitvarsigma}
+\newunicodechar{𝜎}{\mitsigma}
+\newunicodechar{𝜏}{\mittau}
+\newunicodechar{𝜐}{\mitupsilon}
+\newunicodechar{𝜑}{\mitvarphi}
+\newunicodechar{𝜒}{\mitchi}
+\newunicodechar{𝜓}{\mitpsi}
+\newunicodechar{𝜔}{\mitomega}
+\fi\fi
+
\iflibertinus@nomath
\RequirePackage{fontspec}
\else
+ \PassOptionsToPackage{\libertinusUNI@feature}{unicode-math}
\RequirePackage{unicode-math}
\fi
@@ -102,9 +193,6 @@
\libertinus@defaultfeatures
}
-\iflibertinus@usefilenames
-%------------------------ filenames start -------------------------
-
\setmainfont{LibertinusSerif}[
RawFeature = {\libertinus@figurealign;\libertinus@figurestyle},
Scale = \libertinusRM@scale ,
@@ -262,184 +350,14 @@
Extension = .otf,
]
\fi
-%------------------------ filenames stop -------------------------
-\else
-%------------------------ symbolic names start -------------------------
-\setmainfont{Libertinus Serif}[
- RawFeature = {\libertinus@figurealign,\libertinus@figurestyle},
- Scale = \libertinusRM@scale ,
- UprightFont = * Regular,
- SlantedFont = * Regular,
- SlantedFeatures = {FakeSlant=0.2},
- ItalicFont = * Italic,
- ItalicFeatures = { SmallCapsFont = * Italic },
- BoldFont = * \libertinus@boldstyle,
- BoldFeatures = { SmallCapsFont = * \libertinus@boldstyle },
- BoldItalicFont = * \libertinus@boldstyle Italic,
- BoldItalicFeatures= { SmallCapsFont = * \libertinus@boldstyle Italic },
- SmallCapsFont = * Regular,
- SmallCapsFeatures = {RawFeature=+smcp},
- BoldSlantedFont = * \libertinus@boldstyle,
- BoldSlantedFeatures = {FakeSlant=0.2, SmallCapsFont = * \libertinus@boldstyle },
- SmallCapsFeatures = {Letters=SmallCaps},
-]
-\newfontfamily\LibertinusSerif{Libertinus Serif}[
- RawFeature = {\libertinus@figurealign,\libertinus@figurestyle},
- Scale = \libertinusRM@scale ,
- UprightFont = * Regular,
- SlantedFont = * Regular,
- SlantedFeatures = {FakeSlant=0.2},
- ItalicFont = * Italic,
- ItalicFeatures = { SmallCapsFont = * Italic },
- BoldFont = * \libertinus@boldstyle,
- BoldFeatures = { SmallCapsFont = * \libertinus@boldstyle },
- BoldItalicFont = * \libertinus@boldstyle Italic,
- BoldItalicFeatures= { SmallCapsFont = * \libertinus@boldstyle Italic },
- SmallCapsFont = * Regular,
- SmallCapsFeatures = {RawFeature=+smcp},
- BoldSlantedFont = * \libertinus@boldstyle,
- BoldSlantedFeatures = {FakeSlant=0.2, SmallCapsFont = * \libertinus@boldstyle },
- SmallCapsFeatures = {Letters=SmallCaps},
-]
-\newfontfamily\LibertinusSerifSB{Libertinus Serif}[
- RawFeature = {\libertinus@figurealign,\libertinus@figurestyle},
- Scale = \libertinusRM@scale ,
- UprightFont = * Regular,
- SlantedFont = * Regular,
- SlantedFeatures = {FakeSlant=0.2},
- ItalicFont = * Italic,
- ItalicFeatures = { SmallCapsFont = * Italic },
- BoldFont = * Semibold,
- BoldFeatures = { SmallCapsFont = * Semibold},
- BoldItalicFont = * SemiboldItalic,
- BoldItalicFeatures= { SmallCapsFont = * SemiboldItalic },
- SmallCapsFont = * Regular,
- SmallCapsFeatures = {RawFeature=+smcp},
- BoldSlantedFont = * Semibold,
- BoldSlantedFeatures = {FakeSlant=0.2, SmallCapsFont = * Semibold},
- SmallCapsFeatures = {Letters=SmallCaps},
-]
-\newfontfamily\LibertinusSerifOsF{Libertinus Serif}[
- RawFeature = {OldStyle,Proportional},
- Scale = \libertinusRM@scale ,
- UprightFont = * Regular,
- SlantedFont = * Regular,
- SlantedFeatures = {FakeSlant=0.2},
- ItalicFont = * Italic,
- ItalicFeatures = { SmallCapsFont = * Italic },
- BoldFont = * \libertinus@boldstyle,
- BoldFeatures = { SmallCapsFont = * \libertinus@boldstyle },
- BoldItalicFont = * \libertinus@boldstyle Italic,
- BoldItalicFeatures= { SmallCapsFont = * \libertinus@boldstyle Italic },
- SmallCapsFont = * Regular,
- SmallCapsFeatures = {RawFeature=+smcp},
- BoldSlantedFont = * \libertinus@boldstyle,
- BoldSlantedFeatures = {FakeSlant=0.2, SmallCapsFont = * \libertinus@boldstyle },
- SmallCapsFeatures = {Letters=SmallCaps},
-]
-
-\newfontfamily\LibertinusSerifTLF{Libertinus Serif}[
- RawFeature = {Lining,Monospaced},
- Scale = \libertinusRM@scale ,
- UprightFont = * Regular,
- SlantedFont = * Regular,
- SlantedFeatures = {FakeSlant=0.2},
- ItalicFont = * Italic,
- ItalicFeatures = { SmallCapsFont = * Italic },
- BoldFont = * \libertinus@boldstyle,
- BoldFeatures = { SmallCapsFont = * \libertinus@boldstyle },
- BoldItalicFont = * \libertinus@boldstyle Italic,
- BoldItalicFeatures= { SmallCapsFont = * \libertinus@boldstyle Italic },
- SmallCapsFont = * Regular,
- SmallCapsFeatures = {RawFeature=+smcp},
- BoldSlantedFont = * \libertinus@boldstyle,
- BoldSlantedFeatures = {FakeSlant=0.2, SmallCapsFont = * \libertinus@boldstyle },
- SmallCapsFeatures = {Letters=SmallCaps},
-]
-
-\setsansfont{Libertinus Sans}[
- RawFeature = {\libertinus@figurealign;\libertinus@figurestyle},
- Scale = \libertinusSF@scale,
- UprightFont = * Regular,
- ItalicFont = * Italic,
- ItalicFeatures = { SmallCapsFont = * Italic },
- SlantedFont = * Regular,
- SlantedFeatures= {FakeSlant=0.2},
- BoldFont = * Bold,
- BoldFeatures = { SmallCapsFont = * Bold },
- BoldItalicFont = * Italic,
- BoldItalicFeatures = {RawFeature={embolden=3},SmallCapsFont = * Italic },
- BoldSlantedFont= * Bold,
- BoldSlantedFeatures = {FakeSlant=0.2, SmallCapsFont = * Bold },
- SmallCapsFont = * Regular,
-% SmallCapsFeatures={RawFeature=+smcp},
- SmallCapsFeatures={Letters=SmallCaps},
-]
-
-\newfontfamily\LibertinusSansOsF{Libertinus Sans}[
- RawFeature = {OldStyle,Proportional} ,
- Scale = \libertinusSF@scale ,
- UprightFont = * Regular,
- ItalicFont = * Italic,
- ItalicFeatures = { SmallCapsFont = * Italic },
- SlantedFont = * Regular,
- SlantedFeatures= {FakeSlant=0.2},
- BoldFont = * Bold,
- BoldFeatures = { SmallCapsFont = * Bold },
- BoldItalicFont = * Italic,
- BoldItalicFeatures = {RawFeature={embolden=3}},
- SmallCapsFont = * Regular,
- SmallCapsFeatures={RawFeature=+smcp},
- BoldSlantedFont= * Bold,
- BoldSlantedFeatures = {FakeSlant=0.2, SmallCapsFont = * Bold },
- SmallCapsFeatures={Letters=SmallCaps},
-% Extension = .otf
-]
-\newfontfamily\LibertinusSansTLF{Libertinus Sans}[
- RawFeature = {Lining, Monospaced} ,
- Scale = \libertinusSF@scale ,
- UprightFont = * Regular,
- ItalicFont = * Italic,
- ItalicFeatures = { SmallCapsFont = * Italic },
- SlantedFont = * Regular,
- SlantedFeatures= {FakeSlant=0.2},
- BoldFont = * Bold,
- BoldFeatures = { SmallCapsFont = * Bold },
- BoldItalicFont = * Italic,
- BoldItalicFeatures = {RawFeature={embolden=3}},
- SmallCapsFont = *-Regular,
- SmallCapsFeatures={RawFeature=+smcp},
- BoldSlantedFont= * Bold,
- BoldSlantedFeatures = {FakeSlant=0.2, SmallCapsFont = * Bold },
- SmallCapsFeatures={Letters=SmallCaps},
-% Extension = .otf
-]
-\iflibertinus@mono
-\setmonofont{Libertinus Mono}[
-% RawFeature = {\libertinus@figurealign, \libertinus@figurestyle},
- Scale = \libertinusTT@scale,
- FakeStretch = \libertinusTT@stretch,
- UprightFont = * Regular,
- ItalicFont = * Regular,
- ItalicFeatures = {FakeSlant=0.2},
- SlantedFont = * Regular,
- SlantedFeatures= {FakeSlant=0.2},
- BoldFont = * Regular,
- BoldFeatures = {RawFeature={embolden=3}},
- BoldItalicFont = * Regular,
- BoldItalicFeatures={FakeSlant=0.2,RawFeature={embolden=3}},
-]
-\fi
-\fi
-%------------------------ symbolic names stop -------------------------
-
\iflibertinus@nomath\else
\typeout{*************************************^^J%
* Using libertinus math *^^J%
*************************************}%
- \setmathfont{LibertinusMath-Regular.otf}[RawFeature=\libertinusMM@feature]
- \setmathfont[version=bold,RawFeature={embolden=3,\libertinusMM@feature}]{LibertinusMath-Regular.otf}
+ \expandafter\setmathfont\expandafter[\libertinusMM@feature]{LibertinusMath-Regular.otf}
+ \expandafter\setmathfont\expandafter[\libertinusMM@feature,version=bold,
+ RawFeature={embolden=3}]{LibertinusMath-Regular.otf}
\fi
\ifluatex