summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/alegreya/Alegreya.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/alegreya/Alegreya.sty')
-rw-r--r--Master/texmf-dist/tex/latex/alegreya/Alegreya.sty137
1 files changed, 58 insertions, 79 deletions
diff --git a/Master/texmf-dist/tex/latex/alegreya/Alegreya.sty b/Master/texmf-dist/tex/latex/alegreya/Alegreya.sty
index d6406947df7..0bab544ac81 100644
--- a/Master/texmf-dist/tex/latex/alegreya/Alegreya.sty
+++ b/Master/texmf-dist/tex/latex/alegreya/Alegreya.sty
@@ -1,15 +1,15 @@
\ProvidesPackage{Alegreya}[%
- 2016/08/19 (Bob Tennent) Supports Alegreya and AlegreyaSC fonts for all LaTeX engines. ]
+ 2018/03/05 (Bob Tennent) Supports Alegreya and AlegreyaSC fonts for all LaTeX engines. ]
\RequirePackage{ifxetex,ifluatex,textcomp}
-\newif\ifAlegreya@ttf
+\newif\ifAlegreya@otf
\ifxetex
- \Alegreya@ttftrue
+ \Alegreya@otftrue
\else\ifluatex
- \Alegreya@ttftrue
+ \Alegreya@otftrue
\else % [pdf]LaTeX
- \Alegreya@ttffalse
+ \Alegreya@otffalse
\fi\fi
\newif\ifAlegreya@lining \Alegreya@liningtrue
@@ -21,7 +21,7 @@
\DeclareOptionX{scaled}{\renewcommand*{\Alegreya@scale}{#1}}
\DeclareOptionX{scale}{\renewcommand*{\Alegreya@scale}{#1}}
-\DeclareOptionX{type1}{\Alegreya@ttffalse}
+\DeclareOptionX{type1}{\Alegreya@otffalse}
\DeclareOptionX{lining}[true]{%
\@nameuse{if#1}%
@@ -83,12 +83,16 @@
\fi
}
-\def\bfseries@sf{b}\def\Alegreya@boldstyle{Bold}
+\def\bfseries@rm{b}\def\Alegreya@boldstyle{Bold}
\DeclareOptionX{black}{\edef\bfseries@rm{k}\edef\Alegreya@boldstyle{Black}}
+\DeclareOptionX{extrabold}{\edef\bfseries@rm{eb}\edef\Alegreya@boldstyle{ExtraBold}}
+
+\def\mdseries@rm{m}\def\Alegreya@regstyle{Regular}
+\DeclareOptionX{medium}{\edef\mdseries@rm{mb}\edef\Alegreya@regstyle{Medium}}
\ProcessOptionsX\relax
-\ifAlegreya@ttf
+\ifAlegreya@otf
\ifAlegreya@lining
\def\Alegreya@figurestyle{Lining}
\else
@@ -115,29 +119,26 @@
\fi
-\ifAlegreya@ttf
+\ifAlegreya@otf
\RequirePackage{fontspec}
\else
\RequirePackage{fontenc,fontaxes,mweights}
\fi
-\ifAlegreya@ttf
+\ifAlegreya@otf
+ \def\Alegreya@regular{Regular}
\ifxetex\XeTeXtracingfonts=1\fi
\defaultfontfeatures{
Ligatures = TeX ,
- Extension = .ttf ,
+ Extension = .otf ,
Scale = \Alegreya@scale ,
}
\setmainfont
[ Numbers = {\Alegreya@figurealign,\Alegreya@figurestyle},
- UprightFont = *-Regular ,
- ItalicFont = *-Italic ,
+ UprightFont = *-\Alegreya@regstyle ,
+ ItalicFont = *-\ifx\Alegreya@regstyle\Alegreya@regular Italic\else\Alegreya@regstyle Italic\fi ,
BoldFont = *-\Alegreya@boldstyle ,
BoldItalicFont = *-\Alegreya@boldstyle Italic ,
- UprightFeatures = { SmallCapsFont = AlegreyaSC-Regular },
- BoldFeatures = { SmallCapsFont= AlegreyaSC-\Alegreya@boldstyle },
- ItalicFeatures = { SmallCapsFont= AlegreyaSC-Italic },
- BoldItalicFeatures = { SmallCapsFont= AlegreyaSC-\Alegreya@boldstyle Italic },
]
{Alegreya}
% grab current family in case of subsequent change:
@@ -146,19 +147,15 @@
\edef\Alegreya@figurestyle{OldStyle}
\defaultfontfeatures{
Ligatures = TeX ,
- Extension = .ttf ,
+ Extension = .otf ,
Scale = \Alegreya@scale ,
}
\setmainfont
[ Numbers = {\Alegreya@figurealign,\Alegreya@figurestyle},
- UprightFont = *-Regular ,
- ItalicFont = *-Italic ,
- BoldFont = *-\Alegreya@boldstyle ,
- BoldItalicFont = *-\Alegreya@boldstyle Italic ,
- UprightFeatures = { SmallCapsFont = AlegreyaSC-Regular },
- BoldFeatures = { SmallCapsFont= AlegreyaSC-\Alegreya@boldstyle },
- ItalicFeatures = { SmallCapsFont= AlegreyaSC-Italic },
- BoldItalicFeatures = { SmallCapsFont= AlegreyaSC-\Alegreya@boldstyle Italic },
+ UprightFont = *-\Alegreya@regstyle ,
+ ItalicFont = *-\ifx\Alegreya@regstyle\Alegreya@regular Italic\else\Alegreya@regstyle Italic\fi ,
+ BoldFont = *-\Alegreya@boldstyle ,
+ BoldItalicFont = *-\Alegreya@boldstyle Italic ,
]
{Alegreya}
\def\rmfamily{\Alegreya@OsF}
@@ -168,74 +165,50 @@
\newfontfamily\Alegreya
[ Numbers = {\Alegreya@figurealign,\Alegreya@figurestyle},
- UprightFont = *-Regular ,
- ItalicFont = *-Italic ,
+ UprightFont = *-\Alegreya@regstyle ,
+ ItalicFont = *-\ifx\Alegreya@regstyle\Alegreya@regular Italic\else\Alegreya@regstyle Italic\fi ,
BoldFont = *-\Alegreya@boldstyle ,
BoldItalicFont = *-\Alegreya@boldstyle Italic ,
- UprightFeatures = { SmallCapsFont = AlegreyaSC-Regular },
- BoldFeatures = { SmallCapsFont= AlegreyaSC-\Alegreya@boldstyle },
- ItalicFeatures = { SmallCapsFont= AlegreyaSC-Italic },
- BoldItalicFeatures = { SmallCapsFont= AlegreyaSC-\Alegreya@boldstyle Italic },
]
{Alegreya}
\newfontfamily\AlegreyaOsF
[ Numbers = {Proportional,OldStyle},
- UprightFont = *-Regular ,
- ItalicFont = *-Italic ,
- BoldFont = *-\Alegreya@boldstyle ,
- BoldItalicFont = *-\Alegreya@boldstyle Italic ,
- UprightFeatures = { SmallCapsFont = AlegreyaSC-Regular },
- BoldFeatures = { SmallCapsFont= AlegreyaSC-\Alegreya@boldstyle },
- ItalicFeatures = { SmallCapsFont= AlegreyaSC-Italic },
- BoldItalicFeatures = { SmallCapsFont= AlegreyaSC-\Alegreya@boldstyle Italic },
+ UprightFont = *-\Alegreya@regstyle ,
+ ItalicFont = *-\ifx\Alegreya@regstyle\Alegreya@regular Italic\else\Alegreya@regstyle Italic\fi ,
+ BoldFont = *-\Alegreya@boldstyle ,
+ BoldItalicFont = *-\Alegreya@boldstyle Italic ,
]
{Alegreya}
\newfontfamily\AlegreyaLF
[ Numbers = {Proportional,Lining},
- UprightFont = *-Regular ,
- ItalicFont = *-Italic ,
- BoldFont = *-\Alegreya@boldstyle ,
- BoldItalicFont = *-\Alegreya@boldstyle Italic ,
- UprightFeatures = { SmallCapsFont = AlegreyaSC-Regular },
- BoldFeatures = { SmallCapsFont= AlegreyaSC-\Alegreya@boldstyle },
- ItalicFeatures = { SmallCapsFont= AlegreyaSC-Italic },
- BoldItalicFeatures = { SmallCapsFont= AlegreyaSC-\Alegreya@boldstyle Italic },
+ UprightFont = *-\Alegreya@regstyle ,
+ ItalicFont = *-\ifx\Alegreya@regstyle\Alegreya@regular Italic\else\Alegreya@regstyle Italic\fi ,
+ BoldFont = *-\Alegreya@boldstyle ,
+ BoldItalicFont = *-\Alegreya@boldstyle Italic ,
]
{Alegreya}
\newfontfamily\AlegreyaTOsF
[ Numbers = {Monospaced,OldStyle},
- UprightFont = *-Regular ,
- ItalicFont = *-Italic ,
- BoldFont = *-\Alegreya@boldstyle ,
- BoldItalicFont = *-\Alegreya@boldstyle Italic ,
- UprightFeatures = { SmallCapsFont = AlegreyaSC-Regular },
- BoldFeatures = { SmallCapsFont= AlegreyaSC-\Alegreya@boldstyle },
- ItalicFeatures = { SmallCapsFont= AlegreyaSC-Italic },
- BoldItalicFeatures = { SmallCapsFont= AlegreyaSC-\Alegreya@boldstyle Italic },
+ UprightFont = *-\Alegreya@regstyle ,
+ ItalicFont = *-\ifx\Alegreya@regstyle\Alegreya@regular Italic\else\Alegreya@regstyle Italic\fi ,
+ BoldFont = *-\Alegreya@boldstyle ,
+ BoldItalicFont = *-\Alegreya@boldstyle Italic ,
]
{Alegreya}
\newfontfamily\Alegreya@OsF % for \useosf
[ Numbers = {\Alegreya@figurealign, OldStyle},
- UprightFont = *-Regular ,
- ItalicFont = *-Italic ,
- BoldFont = *-\Alegreya@boldstyle ,
- BoldItalicFont = *-\Alegreya@boldstyle Italic,
- UprightFeatures = { SmallCapsFont = AlegreyaSC-Regular },
- BoldFeatures = { SmallCapsFont= AlegreyaSC-\Alegreya@boldstyle },
- ItalicFeatures = { SmallCapsFont= AlegreyaSC-Italic },
- BoldItalicFeatures = { SmallCapsFont= AlegreyaSC-\Alegreya@boldstyle Italic },
+ UprightFont = *-\Alegreya@regstyle ,
+ ItalicFont = *-\ifx\Alegreya@regstyle\Alegreya@regular Italic\else\Alegreya@regstyle Italic\fi ,
+ BoldFont = *-\Alegreya@boldstyle ,
+ BoldItalicFont = *-\Alegreya@boldstyle Italic ,
]
{Alegreya}
\newfontfamily\AlegreyaTLF
[ Numbers = {Monospaced,Lining},
- UprightFont = *-Regular ,
- ItalicFont = *-Italic ,
- BoldFont = *-\Alegreya@boldstyle ,
- BoldItalicFont = *-\Alegreya@boldstyle Italic ,
- UprightFeatures = { SmallCapsFont = AlegreyaSC-Regular },
- BoldFeatures = { SmallCapsFont= AlegreyaSC-\Alegreya@boldstyle },
- ItalicFeatures = { SmallCapsFont= AlegreyaSC-Italic },
- BoldItalicFeatures = { SmallCapsFont= AlegreyaSC-\Alegreya@boldstyle Italic },
+ UprightFont = *-\Alegreya@regstyle ,
+ ItalicFont = *-\ifx\Alegreya@regstyle\Alegreya@regular Italic\else\Alegreya@regstyle Italic\fi ,
+ BoldFont = *-\Alegreya@boldstyle ,
+ BoldItalicFont = *-\Alegreya@boldstyle Italic ,
]
{Alegreya}
\newfontfamily\AlegreyaBlack
@@ -244,16 +217,21 @@
ItalicFont = *-BlackItalic ,
BoldFont = *-Black ,
BoldItalicFont = *-BlackItalic ,
- UprightFeatures = { SmallCapsFont = AlegreyaSC-Black },
- BoldFeatures = { SmallCapsFont= AlegreyaSC-Black },
- ItalicFeatures = { SmallCapsFont= AlegreyaSC-BlackItalic },
- BoldItalicFeatures = { SmallCapsFont= AlegreyaSC-BlackItalic },
- ]
+ ]
+ {Alegreya}
+
+ \newfontfamily\AlegreyaMedium
+ [ Numbers = {\Alegreya@figurealign,\Alegreya@figurestyle},
+ UprightFont = *-Medium ,
+ ItalicFont = *-MediumItalic ,
+ BoldFont = *-Medium ,
+ BoldItalicFont = *-MediumItalic ,
+ ]
{Alegreya}
\def\rmfamily{\Alegreya}
\providecommand\sufigures{\addfontfeatures{VerticalPosition=Superior}}
- \providecommand\infigures{\addfontfeatures{VerticalPosition=ScientificInferior}}
+ \providecommand\infigures{\addfontfeatures{VerticalPosition=Inferior}}
\else % type1
@@ -265,6 +243,7 @@
\def\AlegreyaTLF{\fontfamily{Alegreya-TLF}\selectfont}
\def\AlegreyaTOsF{\fontfamily{Alegreya-TOsF}\selectfont}
\def\AlegreyaBlack{\fontfamily{\Alegreyafamily}\fontseries{k}\selectfont}
+ \def\AlegreyaMedium{\fontfamily{\Alegreyafamily}\fontseries{mb}\selectfont}
\fa@naming@exception{figures}{{superior}{proportional}}{Sup}
\fa@naming@exception{figures}{{superior}{tabular}}{Sup}
@@ -283,7 +262,7 @@
\DeclareTextFontCommand{\textin}{\infigures}
% turn off defaults in case other fonts are selected:
-\ifAlegreya@ttf
+\ifAlegreya@otf
\defaultfontfeatures{}
\fi