summaryrefslogtreecommitdiff
path: root/fonts/librecaslon/latex/librecaslon.sty
diff options
context:
space:
mode:
Diffstat (limited to 'fonts/librecaslon/latex/librecaslon.sty')
-rw-r--r--fonts/librecaslon/latex/librecaslon.sty74
1 files changed, 15 insertions, 59 deletions
diff --git a/fonts/librecaslon/latex/librecaslon.sty b/fonts/librecaslon/latex/librecaslon.sty
index 8568633493..63d68c7045 100644
--- a/fonts/librecaslon/latex/librecaslon.sty
+++ b/fonts/librecaslon/latex/librecaslon.sty
@@ -1,16 +1,14 @@
\ProvidesPackage{librecaslon}[%
- 2019/06/25 (Bob Tennent) Supports LibreCaslon fonts for all LaTeX engines. ]
+ 2020/07/24 (Bob Tennent) Supports LibreCaslon fonts for xeLaTeX and luaLaTeX. ]
-\RequirePackage{ifxetex,ifluatex,textcomp}
+\RequirePackage{iftex}
-\newif\iflibrecaslon@otf
-\ifxetex
- \librecaslon@otftrue
-\else\ifluatex
- \librecaslon@otftrue
-\else % [pdf]LaTeX
- \librecaslon@otffalse
-\fi\fi
+\ifpdftex
+\PackageError{librecaslon}{%
+ *****************************************\MessageBreak
+ Please process using XeLaTeX or luaLaTeX\MessageBreak
+ *****************************************}
+\fi
\newif\iflibrecaslon@lining \librecaslon@liningtrue
@@ -19,8 +17,6 @@
\DeclareOptionX{scaled}{\renewcommand*{\LibreCaslon@scale}{#1}}
\DeclareOptionX{scale}{\renewcommand*{\LibreCaslon@scale}{#1}}
-\DeclareOptionX{type1}{\librecaslon@otffalse}
-
\DeclareOptionX{lining}[true]{%
\@nameuse{if#1}%
\librecaslon@liningtrue
@@ -53,32 +49,14 @@
\ProcessOptionsX\relax
-\iflibrecaslon@otf
\iflibrecaslon@lining
\def\librecaslon@figurestyle{Monospaced}
\else
\def\librecaslon@figurestyle{OldStyle}
\fi
-\else % type1
-
- \iflibrecaslon@lining
- \def\librecaslon@figurealign{T}
- \def\librecaslon@figurestyle{LF}
- \else
- \def\librecaslon@figurealign{}
- \def\librecaslon@figurestyle{OsF}
- \fi
-\fi
-
-
-\iflibrecaslon@otf
- \RequirePackage{fontspec}
-\else
- \RequirePackage{fontenc,fontaxes}
-\fi
+\RequirePackage{fontspec}
-\iflibrecaslon@otf
\ifxetex\XeTeXtracingfonts=1\fi
\defaultfontfeatures{
Ligatures = TeX ,
@@ -90,7 +68,7 @@
UprightFont = *-Regular ,
ItalicFont = *-Italic ,
BoldFont = *-Bold ,
- BoldItalicFont = *-BoldItalic ]
+ ]
{LibreCaslonText}
\providecommand\useosf{%
\edef\librecaslon@figurestyle{OldStyle}
@@ -104,7 +82,7 @@
UprightFont = *-Regular ,
ItalicFont = *-Italic ,
BoldFont = *-Bold ,
- BoldItalicFont = *-BoldItalic ]
+ ]
{LibreCaslonText}
\defaultfontfeatures{}
}
@@ -113,61 +91,39 @@
UprightFont = *-Regular ,
ItalicFont = *-Italic ,
BoldFont = *-Bold ,
- BoldItalicFont = *-BoldItalic ]
+ ]
{LibreCaslonText}
\newfontfamily\librecaslonOsF
[ Numbers = {OldStyle},
UprightFont = *-Regular ,
ItalicFont = *-Italic ,
BoldFont = *-Bold ,
- BoldItalicFont = *-BoldItalic ]
+ ]
{LibreCaslonText}
\newfontfamily\librecaslonLF
[ Numbers = {},
UprightFont = *-Regular ,
ItalicFont = *-Italic ,
BoldFont = *-Bold ,
- BoldItalicFont = *-BoldItalic ]
+ ]
{LibreCaslonText}
\newfontfamily\librecaslonTLF
[ Numbers = {Monospaced},
UprightFont = *-Regular ,
ItalicFont = *-Italic ,
BoldFont = *-Bold ,
- BoldItalicFont = *-BoldItalic ]
+ ]
{LibreCaslonText}
\providecommand\sufigures{\librecaslonOsF\addfontfeatures{VerticalPosition=Superior}}
\providecommand\infigures{\librecaslonOsF\addfontfeatures{VerticalPosition=ScientificInferior}}
-\else % type1
-
- \def\librecaslonfamily{LibreCaslon-\librecaslon@figurealign\librecaslon@figurestyle}
- \providecommand*\librecaslon{\fontfamily{\librecaslonfamily}\selectfont}
- \providecommand*\librecaslonLF{\fontfamily{LibreCaslon-LF}\selectfont}
- \providecommand*\librecaslonTLF{\fontfamily{LibreCaslon-TLF}\selectfont}
- \providecommand*\librecaslonOsF{\fontfamily{LibreCaslon-OsF}\selectfont}
-
- \fa@naming@exception{figures}{{superior}{proportional}}{Sup}
- \fa@naming@exception{figures}{{superior}{tabular}}{Sup}
- \providecommand\sufigures{\@nomath\sufigures\fontfigurestyle{superior}\selectfont}
- \fa@naming@exception{figures}{{inferior}{proportional}}{Inf}
- \fa@naming@exception{figures}{{inferior}{tabular}}{Inf}
- \def\infigures{\@nomath\infigures\fontfigurestyle{inferior}\selectfont}
-
- \renewcommand*\rmdefault{\librecaslonfamily}
- \providecommand*\useosf{\edef\librecaslon@figurealign{}\edef\librecaslon@figurestyle{OsF}%
- \renewcommand*{\rmdefault}{LibreCaslon-OsF}}
-
-\fi
\DeclareTextFontCommand{\textsu}{\sufigures}
\DeclareTextFontCommand{\textin}{\infigures}
% turn off defaults in case other fonts are selected:
-\iflibrecaslon@otf
\defaultfontfeatures{}
-\fi
\endinput