From 71c876217b8d8b05eef7acf91b1a13d2e5262091 Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Wed, 29 Jul 2020 03:04:04 +0000
Subject: CTAN sync 202007290304

---
 fonts/librecaslon/latex/librecaslon.sty | 80 ++++++++++++++++++++++++++-------
 1 file changed, 65 insertions(+), 15 deletions(-)

(limited to 'fonts/librecaslon/latex/librecaslon.sty')

diff --git a/fonts/librecaslon/latex/librecaslon.sty b/fonts/librecaslon/latex/librecaslon.sty
index 63d68c7045..f899f51d28 100644
--- a/fonts/librecaslon/latex/librecaslon.sty
+++ b/fonts/librecaslon/latex/librecaslon.sty
@@ -1,14 +1,16 @@
 \ProvidesPackage{librecaslon}[%
-   2020/07/24 (Bob Tennent)  Supports LibreCaslon fonts for xeLaTeX and luaLaTeX. ] 
+   2020/07/28 (Bob Tennent)  Supports LibreCaslon fonts for all LaTeX engines. ] 
 
-\RequirePackage{iftex}
+\RequirePackage{ifxetex,ifluatex,textcomp}
 
-\ifpdftex
-\PackageError{librecaslon}{%
- *****************************************\MessageBreak
-  Please process using XeLaTeX or luaLaTeX\MessageBreak
- *****************************************}
-\fi  
+\newif\iflibrecaslon@otf
+\ifxetex
+  \librecaslon@otftrue
+\else\ifluatex
+  \librecaslon@otftrue
+\else  % [pdf]LaTeX
+  \librecaslon@otffalse
+\fi\fi
 
 \newif\iflibrecaslon@lining \librecaslon@liningtrue
 
@@ -17,6 +19,8 @@
 \DeclareOptionX{scaled}{\renewcommand*{\LibreCaslon@scale}{#1}}
 \DeclareOptionX{scale}{\renewcommand*{\LibreCaslon@scale}{#1}}
 
+\DeclareOptionX{type1}{\librecaslon@otffalse}
+
 \DeclareOptionX{lining}[true]{%
 \@nameuse{if#1}%
   \librecaslon@liningtrue
@@ -49,14 +53,32 @@
 
 \ProcessOptionsX\relax
 
+\iflibrecaslon@otf
   \iflibrecaslon@lining
     \def\librecaslon@figurestyle{Monospaced}
   \else
     \def\librecaslon@figurestyle{OldStyle}
   \fi
 
-\RequirePackage{fontspec}
+\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
+
+\iflibrecaslon@otf
   \ifxetex\XeTeXtracingfonts=1\fi
   \defaultfontfeatures{
      Ligatures = TeX ,
@@ -68,7 +90,8 @@
         UprightFont    = *-Regular ,
         ItalicFont     = *-Italic ,
         BoldFont       = *-Bold , 
-        ]
+        BoldItalicFont = LibreCsln-BoldItalic,
+      ]
       {LibreCaslonText}
   \providecommand\useosf{%
     \edef\librecaslon@figurestyle{OldStyle}
@@ -82,7 +105,8 @@
           UprightFont    = *-Regular ,
           ItalicFont     = *-Italic ,
           BoldFont       = *-Bold , 
-          ]
+          BoldItalicFont = LibreCsln-BoldItalic,
+        ]
         {LibreCaslonText}
     \defaultfontfeatures{}
   }
@@ -91,39 +115,65 @@
         UprightFont    = *-Regular ,
         ItalicFont     = *-Italic ,
         BoldFont       = *-Bold , 
-        ]
+        BoldItalicFont = LibreCsln-BoldItalic,
+      ]
       {LibreCaslonText}
   \newfontfamily\librecaslonOsF
         [ Numbers = {OldStyle},
         UprightFont    = *-Regular ,
         ItalicFont     = *-Italic ,
         BoldFont       = *-Bold , 
-        ]
+        BoldItalicFont = LibreCsln-BoldItalic,
+      ]
       {LibreCaslonText}
   \newfontfamily\librecaslonLF
         [ Numbers = {},
         UprightFont    = *-Regular ,
         ItalicFont     = *-Italic ,
         BoldFont       = *-Bold , 
-        ]
+        BoldItalicFont = LibreCsln-BoldItalic,
+      ]
       {LibreCaslonText}
   \newfontfamily\librecaslonTLF
         [ Numbers = {Monospaced},
         UprightFont    = *-Regular ,
         ItalicFont     = *-Italic ,
         BoldFont       = *-Bold , 
-        ]
+        BoldItalicFont = LibreCsln-BoldItalic,
+      ]
       {LibreCaslonText}
 
   \providecommand\sufigures{\librecaslonOsF\addfontfeatures{VerticalPosition=Superior}}  
   \providecommand\infigures{\librecaslonOsF\addfontfeatures{VerticalPosition=ScientificInferior}}
 
 
+\else % type1
+
+  \def\librecaslonfamily{LibreCsln-\librecaslon@figurealign\librecaslon@figurestyle}
+  \providecommand*\librecaslon{\fontfamily{\librecaslonfamily}\selectfont}
+  \providecommand*\librecaslonLF{\fontfamily{LibreCsln-LF}\selectfont}
+  \providecommand*\librecaslonTLF{\fontfamily{LibreCsln-TLF}\selectfont}
+  \providecommand*\librecaslonOsF{\fontfamily{LibreCsln-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}{LibreCsln-OsF}}
+
+\fi
 \DeclareTextFontCommand{\textsu}{\sufigures}
 \DeclareTextFontCommand{\textin}{\infigures}
 
 % turn off defaults in case other fonts are selected:
+\iflibrecaslon@otf
   \defaultfontfeatures{}
+\fi
 
 \endinput
 
-- 
cgit v1.2.3

