From 2cc1428902acf89607839209b9cf261aec5cf40d Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Mon, 3 Aug 2020 21:32:55 +0000
Subject: almendra (3aug20)

git-svn-id: svn://tug.org/texlive/trunk@56035 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/almendra/almendra.sty | 52 ++++++++++++++++-------
 1 file changed, 37 insertions(+), 15 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/almendra/almendra.sty')

diff --git a/Master/texmf-dist/tex/latex/almendra/almendra.sty b/Master/texmf-dist/tex/latex/almendra/almendra.sty
index cd9c564516a..c400a76276f 100644
--- a/Master/texmf-dist/tex/latex/almendra/almendra.sty
+++ b/Master/texmf-dist/tex/latex/almendra/almendra.sty
@@ -1,35 +1,45 @@
 \ProvidesPackage{almendra}[%
-   2020/07/23 (Bob Tennent)  Supports Almendra fonts for XeLaTeX or LuaLaTeX. ] 
+   2020/08/02 (Bob Tennent)  Supports Almendra fonts for all LaTeX engines. ] 
 
-\RequirePackage{iftex}
+\RequirePackage{ifxetex,ifluatex,textcomp}
 
-\ifpdftex
-\PackageError{almendra}{%
- *****************************************\MessageBreak
-  Please process using XeLaTeX or luaLaTeX\MessageBreak
- *****************************************}
-\fi  
+\newif\ifalmendra@ttf
+\ifxetex
+  \almendra@ttftrue
+\else\ifluatex
+  \almendra@ttftrue
+\else  % [pdf]LaTeX
+  \almendra@ttffalse
+\fi\fi
 
-\newcommand*{\Almendra@scale}{1}  
+\newcommand*{\Almndr@scale}{1}  
 \RequirePackage{xkeyval}
-\DeclareOptionX{scaled}{\renewcommand*{\Almendra@scale}{#1}}
-\DeclareOptionX{scale}{\renewcommand*{\Almendra@scale}{#1}}
+\DeclareOptionX{scaled}{\renewcommand*{\Almndr@scale}{#1}}
+\DeclareOptionX{scale}{\renewcommand*{\Almndr@scale}{#1}}
+
+\DeclareOptionX{type1}{\almendra@ttffalse}
 
 \ProcessOptionsX\relax
 
-\RequirePackage{fontspec}
+\ifalmendra@ttf
+  \RequirePackage{fontspec}
+\else
+  \RequirePackage{fontenc,fontaxes,mweights}
+\fi
 
+\ifalmendra@ttf
   \ifxetex\XeTeXtracingfonts=1\fi
   \defaultfontfeatures{
      Ligatures = TeX ,
      Extension = .ttf ,
+     Scale = \Almndr@scale,
   }
   \setmainfont
       [ UprightFont    = *-Regular ,
         ItalicFont     = *-Italic ,
         BoldFont       = *-Bold , 
         BoldItalicFont = *-BoldItalic ,
-        SmallCapsFont = {AlmendraSmallCaps}
+        SmallCapsFont = {AlmendraSC-Regular}
       ]
       {Almendra}
   \newfontfamily\almendra
@@ -37,12 +47,24 @@
         ItalicFont     = *-Italic ,
         BoldFont       = *-Bold , 
         BoldItalicFont = *-BoldItalic ,
-        SmallCapsFont = {AlmendraSmallCaps}
+        SmallCapsFont = {AlmendraSC-Regular}
       ]
       {Almendra}
 
+\else % type1
+
+  \def\bfseries@rm{b}
+  \def\mdseries@rm{m}
+  \def\almendrafamily{Almndr-OsF}
+  \renewcommand*\rmdefault{\almendrafamily}
+  \newcommand*\almendra{\fontfamily{\almendrafamily}\selectfont}
+
+\fi
+
 % turn off defaults in case other fonts are selected:
-\defaultfontfeatures{}
+\ifalmendra@ttf
+  \defaultfontfeatures{}
+\fi
 
 \endinput
 
-- 
cgit v1.2.3

