diff options
Diffstat (limited to 'fonts/schola-otf/latex')
-rw-r--r-- | fonts/schola-otf/latex/schola-otf.sty | 301 |
1 files changed, 301 insertions, 0 deletions
diff --git a/fonts/schola-otf/latex/schola-otf.sty b/fonts/schola-otf/latex/schola-otf.sty new file mode 100644 index 0000000000..67509368ae --- /dev/null +++ b/fonts/schola-otf/latex/schola-otf.sty @@ -0,0 +1,301 @@ +%% $Id: schola-otf.sty 636 2022-10-17 05:56:11Z 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{schola-otf}[% + 2022/10/17 v. 0.01 (Herbert Voss) Supports TeX Gyre schola fonts for lualatex and xelatex.] + +\RequirePackage{iftex,xkeyval,textcomp} + +\newif\ifschola@lining \schola@liningtrue +\newif\ifschola@tabular \schola@tabulartrue +\newif\ifschola@usefilenames \schola@usefilenamestrue +\newif\ifschola@nomath \schola@nomathfalse +\newif\ifschola@libertinus \schola@libertinusfalse + +\DeclareOptionX{lining}[true]{\@nameuse{schola@lining#1}} +\DeclareOptionX{nf}[true]{\@nameuse{schola@lining#1}} +\DeclareOptionX{lf}[true]{\@nameuse{schola@lining#1}} +\DeclareOptionX{oldstyle}[true]{\@nameuse{if#1}\schola@liningfalse\else\schola@liningtrue\fi} +\DeclareOptionX{osf}[true]{\@nameuse{if#1}\schola@liningfalse\else\schola@liningtrue\fi} +\DeclareOptionX{libertinus}[true]{\@nameuse{schola@libertinus#1}} + +\newcommand*\scholaMM@feature{} +\DeclareOptionX{math}[]{\renewcommand*\scholaMM@feature{#1}} +\DeclareOptionX{nomath}[true]{\@nameuse{schola@nomath#1}} + +\DeclareOptionX{usefilenames}[true]{\@nameuse{schola@usefilenames#1}} + +\DeclareOptionX{tabular}[true]{\@nameuse{schola@tabular#1}} +\DeclareOptionX{t}[true]{\@nameuse{schola@tabular#1}} +\DeclareOptionX{proportional}[true]{\@nameuse{if#1}\schola@tabularfalse\else\schola@tabulartrue\fi} +\DeclareOptionX{p}[true]{\@nameuse{if#1}\schola@tabularfalse\else\schola@tabulartrue\fi} + +\newcommand*\scholaRM@scale{1} +\DeclareOptionX{ScaleRM}{\renewcommand*{\scholaRM@scale}{#1}} + +\def\schola@defaultfeatures{} +\DeclareOptionX{defaultfeatures}{\def\schola@defaultfeatures{#1}} + +\ProcessOptionsX\relax + +\RequirePackage{unicode-math} + +\ifschola@lining + \def\schola@figurestyle{+lnum} +\else + \def\schola@figurestyle{+onum} +\fi + +\ifschola@tabular + \def\schola@figurealign{+tnum} +\else + \def\schola@figurealign{+pnum} +\fi + +\ifxetex\XeTeXtracingfonts=1\fi +\defaultfontfeatures[\rmfamily,\sffamily]{ + Ligatures = TeX , + SmallCapsFeatures={Letters=SmallCaps},% \ifluatex,Renderer=Basic\fi}, + \schola@defaultfeatures +} + +\ifschola@usefilenames +%------------------------ filenames start ------------------------- + +%texgyreschola-bold.otf texgyreschola-italic.otf +%texgyreschola-bolditalic.otf texgyreschola-regular.otf + + +\setmainfont{texgyreschola}[ + RawFeature = {\schola@figurealign;\schola@figurestyle}, + Scale = \scholaRM@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\schola{texgyreschola}[ + RawFeature = {\schola@figurealign;\schola@figurestyle}, + Scale = \scholaRM@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\scholaOsF{texgyreschola}[ + RawFeature = {+onum}, + Scale = \scholaRM@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\scholaTLF{texgyreschola}[ + RawFeature = {+tnum;-onum}, + Scale = \scholaRM@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 Schola}[ + RawFeature = {\schola@figurealign,\schola@figurestyle}, + Scale = \scholaRM@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\schola{TeX Gyre Schola}[ + RawFeature = {\schola@figurealign,\schola@figurestyle}, + Scale = \scholaRM@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\scholaOsF{TeX Gyre Schola}[ + RawFeature = {OldStyle,Proportional}, + Scale = \scholaRM@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\scholaTLF{TeX Gyre Schola}[ + RawFeature = {Lining,Monospaced}, + Scale = \scholaRM@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 ------------------------- + +\ifschola@nomath\else + \typeout{*************************************^^J% + * Using schola math *^^J% + *************************************}% + \setmathfont{texgyreschola-math.otf}[AutoFakeBold,RawFeature=\scholaMM@feature] + \ifschola@libertinus + \setmathfont{LibertinusMath-Regular.otf}[AutoFakeBold,RawFeature=\scholaMM@feature, + range={\int,\iint,\iiint,\iiiint,\oint,\oiint,\oiiint}] + \fi +\fi + +\def\sufigures{\addfontfeatures{VerticalPosition=Superior}} +\DeclareTextFontCommand{\textsup}{\sufigures} +\DeclareTextFontCommand{\textinit}{\scholaInitials}% Initials + +\def\Lsup#1{{\addfontfeature{RawFeature=+sups}#1}} +\def\Lsinf#1{{\addfontfeature{RawFeature=+sinf}#1}} +\def\Land{{\addfontfeature{RawFeature=+ss06}\&}} + +\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 + |