summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/alegreya/AlegreyaSans.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-03-06 22:49:32 +0000
committerKarl Berry <karl@freefriends.org>2018-03-06 22:49:32 +0000
commitce82e0db1ca237293778afa35ee3e88a58df53aa (patch)
treea2bd259b78d8fbdf44a555e557ed47872958f2cf /Master/texmf-dist/tex/latex/alegreya/AlegreyaSans.sty
parent0c97d3210ab17d9a43b8ad5aa8f5b18f8ec0598e (diff)
alegreya (6mar18)
git-svn-id: svn://tug.org/texlive/trunk@46860 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/alegreya/AlegreyaSans.sty')
-rw-r--r--Master/texmf-dist/tex/latex/alegreya/AlegreyaSans.sty155
1 files changed, 71 insertions, 84 deletions
diff --git a/Master/texmf-dist/tex/latex/alegreya/AlegreyaSans.sty b/Master/texmf-dist/tex/latex/alegreya/AlegreyaSans.sty
index 3fc1d22e897..2aca4b83319 100644
--- a/Master/texmf-dist/tex/latex/alegreya/AlegreyaSans.sty
+++ b/Master/texmf-dist/tex/latex/alegreya/AlegreyaSans.sty
@@ -1,31 +1,31 @@
\ProvidesPackage{AlegreyaSans}[%
- 2016/09/15 (Bob Tennent) Supports AlegreyaSans and AlegreyaSansSC fonts for all LaTeX engines. ]
+ 2018/03/05 (Bob Tennent) Supports AlegreyaSans fonts for all LaTeX engines. ]
\RequirePackage{ifxetex,ifluatex,textcomp}
-\newif\ifAlegreyaSans@ttf
+\newif\ifAlegreyaSans@otf
\ifxetex
- \AlegreyaSans@ttftrue
+ \AlegreyaSans@otftrue
\else\ifluatex
- \AlegreyaSans@ttftrue
+ \AlegreyaSans@otftrue
\else % [pdf]LaTeX
- \AlegreyaSans@ttffalse
+ \AlegreyaSans@otffalse
\fi\fi
+\newif\ifAlegreyaSans@lining \AlegreyaSans@liningtrue
+\newif\ifAlegreyaSans@tabular \AlegreyaSans@tabularfalse
+\newif\ifAlegreyaSans@black \AlegreyaSans@blackfalse
-\RequirePackage{xkeyval}
\newcommand*{\AlegreyaSans@scale}{1}
+\RequirePackage{xkeyval}
\DeclareOptionX{scaled}{\renewcommand*{\AlegreyaSans@scale}{#1}}
\DeclareOptionX{scale}{\renewcommand*{\AlegreyaSans@scale}{#1}}
-\DeclareOptionX{type1}{\AlegreyaSans@ttffalse}
+\DeclareOptionX{type1}{\AlegreyaSans@otffalse}
\newif\ifAlegreyaSans@default \AlegreyaSans@defaultfalse
\DeclareOptionX{sfdefault}{\AlegreyaSans@defaulttrue}
-\newif\ifAlegreyaSans@lining \AlegreyaSans@liningtrue
-\newif\ifAlegreyaSans@tabular \AlegreyaSans@tabularfalse
-
\DeclareOptionX{lining}[true]{%
\@nameuse{if#1}%
\AlegreyaSans@liningtrue
@@ -97,7 +97,7 @@
\ProcessOptionsX\relax
-\ifAlegreyaSans@ttf
+\ifAlegreyaSans@otf
\ifAlegreyaSans@lining
\def\AlegreyaSans@figurestyle{Lining}
\else
@@ -124,92 +124,97 @@
\fi
-\ifAlegreyaSans@ttf
+\ifAlegreyaSans@otf
\RequirePackage{fontspec}
\else
\RequirePackage{fontenc,fontaxes,mweights}
\fi
-\ifAlegreyaSans@ttf
+\ifAlegreyaSans@otf
+ \def\AlegreyaSans@regular{Regular}
\ifxetex\XeTeXtracingfonts=1\fi
\defaultfontfeatures{
Ligatures = TeX ,
- Extension = .ttf ,
+ Extension = .otf ,
Scale = \AlegreyaSans@scale ,
}
\setsansfont
[ Numbers = {\AlegreyaSans@figurealign,\AlegreyaSans@figurestyle},
UprightFont = *-\AlegreyaSans@regularstyle ,
- ItalicFont = *-\AlegreyaSans@regularstyle Italic ,
+ ItalicFont = *-\ifx\AlegreyaSans@regularstyle\AlegreyaSans@regular Italic\else\AlegreyaSans@regularstyle Italic\fi ,
BoldFont = *-\AlegreyaSans@boldstyle ,
BoldItalicFont = *-\AlegreyaSans@boldstyle Italic ,
- UprightFeatures = { SmallCapsFont = AlegreyaSansSC-\AlegreyaSans@regularstyle },
- BoldFeatures = { SmallCapsFont= AlegreyaSansSC-\AlegreyaSans@boldstyle },
- ItalicFeatures = { SmallCapsFont= AlegreyaSansSC-\AlegreyaSans@regularstyle Italic },
- BoldItalicFeatures = { SmallCapsFont= AlegreyaSansSC-\AlegreyaSans@boldstyle Italic },
]
{AlegreyaSans}
% grab current family in case of subsequent change:
- \let\AlegreyaSansfamily\sfdefault
+ \let\AlegreyaSansfamily\rmdefault
+ \def\useosf{%
+ \edef\AlegreyaSans@figurestyle{OldStyle}
+ \defaultfontfeatures{
+ Ligatures = TeX ,
+ Extension = .otf ,
+ Scale = \AlegreyaSans@scale ,
+ }
+ \setsansfont
+ [ Numbers = {\AlegreyaSans@figurealign,\AlegreyaSans@figurestyle},
+ UprightFont = *-\AlegreyaSans@regularstyle ,
+ ItalicFont = *-\ifx\AlegreyaSans@regularstyle\AlegreyaSans@regular Italic\else\AlegreyaSans@regularstyle Italic\fi ,
+ BoldFont = *-\AlegreyaSans@boldstyle ,
+ BoldItalicFont = *-\AlegreyaSans@boldstyle Italic ,
+ ]
+ {AlegreyaSans}
+ \def\rmfamily{\AlegreyaSans@OsF}
+ \defaultfontfeatures{}
+ }
+
+
\newfontfamily\AlegreyaSans
[ Numbers = {\AlegreyaSans@figurealign,\AlegreyaSans@figurestyle},
UprightFont = *-\AlegreyaSans@regularstyle ,
- ItalicFont = *-\AlegreyaSans@regularstyle Italic ,
+ ItalicFont = *-\ifx\AlegreyaSans@regularstyle\AlegreyaSans@regular Italic\else\AlegreyaSans@regularstyle Italic\fi ,
BoldFont = *-\AlegreyaSans@boldstyle ,
BoldItalicFont = *-\AlegreyaSans@boldstyle Italic ,
- UprightFeatures = { SmallCapsFont = AlegreyaSansSC-\AlegreyaSans@regularstyle },
- BoldFeatures = { SmallCapsFont= AlegreyaSansSC-\AlegreyaSans@boldstyle },
- ItalicFeatures = { SmallCapsFont= AlegreyaSansSC-\AlegreyaSans@regularstyle Italic },
- BoldItalicFeatures = { SmallCapsFont= AlegreyaSansSC-\AlegreyaSans@boldstyle Italic },
]
{AlegreyaSans}
\newfontfamily\AlegreyaSansOsF
[ Numbers = {Proportional,OldStyle},
- UprightFont = *-\AlegreyaSans@regularstyle ,
- ItalicFont = *-\AlegreyaSans@regularstyle Italic ,
- BoldFont = *-\AlegreyaSans@boldstyle ,
- BoldItalicFont = *-\AlegreyaSans@boldstyle Italic ,
- UprightFeatures = { SmallCapsFont = AlegreyaSansSC-\AlegreyaSans@regularstyle },
- BoldFeatures = { SmallCapsFont= AlegreyaSansSC-\AlegreyaSans@boldstyle },
- ItalicFeatures = { SmallCapsFont= AlegreyaSansSC-\AlegreyaSans@regularstyle Italic },
- BoldItalicFeatures = { SmallCapsFont= AlegreyaSansSC-\AlegreyaSans@boldstyle Italic },
- ]
+ UprightFont = *-\AlegreyaSans@regularstyle ,
+ ItalicFont = *-\ifx\AlegreyaSans@regularstyle\AlegreyaSans@regular Italic\else\AlegreyaSans@regularstyle Italic\fi ,
+ BoldFont = *-\AlegreyaSans@boldstyle ,
+ BoldItalicFont = *-\AlegreyaSans@boldstyle Italic ,
+ ]
{AlegreyaSans}
\newfontfamily\AlegreyaSansLF
[ Numbers = {Proportional,Lining},
- UprightFont = *-\AlegreyaSans@regularstyle ,
- ItalicFont = *-\AlegreyaSans@regularstyle Italic ,
- BoldFont = *-\AlegreyaSans@boldstyle ,
- BoldItalicFont = *-\AlegreyaSans@boldstyle Italic ,
- UprightFeatures = { SmallCapsFont = AlegreyaSansSC-\AlegreyaSans@regularstyle },
- BoldFeatures = { SmallCapsFont= AlegreyaSansSC-\AlegreyaSans@boldstyle },
- ItalicFeatures = { SmallCapsFont= AlegreyaSansSC-\AlegreyaSans@regularstyle Italic },
- BoldItalicFeatures = { SmallCapsFont= AlegreyaSansSC-\AlegreyaSans@boldstyle Italic },
- ]
+ UprightFont = *-\AlegreyaSans@regularstyle ,
+ ItalicFont = *-\ifx\AlegreyaSans@regularstyle\AlegreyaSans@regular Italic\else\AlegreyaSans@regularstyle Italic\fi ,
+ BoldFont = *-\AlegreyaSans@boldstyle ,
+ BoldItalicFont = *-\AlegreyaSans@boldstyle Italic ,
+ ]
{AlegreyaSans}
\newfontfamily\AlegreyaSansTOsF
[ Numbers = {Monospaced,OldStyle},
- UprightFont = *-\AlegreyaSans@regularstyle ,
- ItalicFont = *-\AlegreyaSans@regularstyle Italic ,
- BoldFont = *-\AlegreyaSans@boldstyle ,
- BoldItalicFont = *-\AlegreyaSans@boldstyle Italic ,
- UprightFeatures = { SmallCapsFont = AlegreyaSansSC-\AlegreyaSans@regularstyle },
- BoldFeatures = { SmallCapsFont= AlegreyaSansSC-\AlegreyaSans@boldstyle },
- ItalicFeatures = { SmallCapsFont= AlegreyaSansSC-\AlegreyaSans@regularstyle Italic },
- BoldItalicFeatures = { SmallCapsFont= AlegreyaSansSC-\AlegreyaSans@boldstyle Italic },
- ]
+ UprightFont = *-\AlegreyaSans@regularstyle ,
+ ItalicFont = *-\ifx\AlegreyaSans@regularstyle\AlegreyaSans@regular Italic\else\AlegreyaSans@regularstyle Italic\fi ,
+ BoldFont = *-\AlegreyaSans@boldstyle ,
+ BoldItalicFont = *-\AlegreyaSans@boldstyle Italic ,
+ ]
+ {AlegreyaSans}
+ \newfontfamily\AlegreyaSans@OsF % for \useosf
+ [ Numbers = {\AlegreyaSans@figurealign, OldStyle},
+ UprightFont = *-\AlegreyaSans@regularstyle ,
+ ItalicFont = *-\ifx\AlegreyaSans@regularstyle\AlegreyaSans@regular Italic\else\AlegreyaSans@regularstyle Italic\fi ,
+ BoldFont = *-\AlegreyaSans@boldstyle ,
+ BoldItalicFont = *-\AlegreyaSans@boldstyle Italic ,
+ ]
{AlegreyaSans}
\newfontfamily\AlegreyaSansTLF
- [ Numbers = {\AlegreyaSans@figurealign,\AlegreyaSans@figurestyle},
- UprightFont = *-\AlegreyaSans@regularstyle ,
- ItalicFont = *-\AlegreyaSans@regularstyle Italic ,
- BoldFont = *-\AlegreyaSans@boldstyle ,
- BoldItalicFont = *-\AlegreyaSans@boldstyle Italic ,
- UprightFeatures = { SmallCapsFont = AlegreyaSansSC-\AlegreyaSans@regularstyle },
- BoldFeatures = { SmallCapsFont= AlegreyaSansSC-\AlegreyaSans@boldstyle },
- ItalicFeatures = { SmallCapsFont= AlegreyaSansSC-\AlegreyaSans@regularstyle Italic },
- BoldItalicFeatures = { SmallCapsFont= AlegreyaSansSC-\AlegreyaSans@boldstyle Italic },
- ]
+ [ Numbers = {Monospaced,Lining},
+ UprightFont = *-\AlegreyaSans@regularstyle ,
+ ItalicFont = *-\ifx\AlegreyaSans@regularstyle\AlegreyaSans@regular Italic\else\AlegreyaSans@regularstyle Italic\fi ,
+ BoldFont = *-\AlegreyaSans@boldstyle ,
+ BoldItalicFont = *-\AlegreyaSans@boldstyle Italic ,
+ ]
{AlegreyaSans}
\newfontfamily\AlegreyaSansBlack
[ Numbers = {\AlegreyaSans@figurealign,\AlegreyaSans@figurestyle},
@@ -217,10 +222,6 @@
ItalicFont = *-BlackItalic ,
BoldFont = *-Black ,
BoldItalicFont = *-BlackItalic ,
- UprightFeatures = { SmallCapsFont = AlegreyaSansSC-Black },
- BoldFeatures = { SmallCapsFont= AlegreyaSansSC-Black },
- ItalicFeatures = { SmallCapsFont= AlegreyaSansSC-BlackItalic },
- BoldItalicFeatures = { SmallCapsFont= AlegreyaSansSC-BlackItalic },
]
{AlegreyaSans}
\newfontfamily\AlegreyaSansExtraBold
@@ -229,10 +230,6 @@
ItalicFont = *-ExtraBoldItalic ,
BoldFont = *-ExtraBold ,
BoldItalicFont = *-ExtraBoldItalic ,
- UprightFeatures = { SmallCapsFont = AlegreyaSansSC-ExtraBold },
- BoldFeatures = { SmallCapsFont= AlegreyaSansSC-ExtraBold },
- ItalicFeatures = { SmallCapsFont= AlegreyaSansSC-ExtraBoldItalic },
- BoldItalicFeatures = { SmallCapsFont= AlegreyaSansSC-ExtraBoldItalic },
]
{AlegreyaSans}
\newfontfamily\AlegreyaSansThin
@@ -241,10 +238,6 @@
ItalicFont = *-ThinItalic ,
BoldFont = *-Thin ,
BoldItalicFont = *-ThinItalic ,
- UprightFeatures = { SmallCapsFont = AlegreyaSansSC-Thin },
- BoldFeatures = { SmallCapsFont= AlegreyaSansSC-Thin },
- ItalicFeatures = { SmallCapsFont= AlegreyaSansSC-ThinItalic },
- BoldItalicFeatures = { SmallCapsFont= AlegreyaSansSC-ThinItalic },
]
{AlegreyaSans}
\newfontfamily\AlegreyaSansLight
@@ -253,10 +246,6 @@
ItalicFont = *-LightItalic ,
BoldFont = *-Light ,
BoldItalicFont = *-LightItalic ,
- UprightFeatures = { SmallCapsFont = AlegreyaSansSC-Light },
- BoldFeatures = { SmallCapsFont= AlegreyaSansSC-Light },
- ItalicFeatures = { SmallCapsFont= AlegreyaSansSC-LightItalic },
- BoldItalicFeatures = { SmallCapsFont= AlegreyaSansSC-LightItalic },
]
{AlegreyaSans}
\newfontfamily\AlegreyaSansMedium
@@ -265,10 +254,6 @@
ItalicFont = *-MediumItalic ,
BoldFont = *-Medium ,
BoldItalicFont = *-MediumItalic ,
- UprightFeatures = { SmallCapsFont = AlegreyaSansSC-Medium },
- BoldFeatures = { SmallCapsFont= AlegreyaSansSC-Medium },
- ItalicFeatures = { SmallCapsFont= AlegreyaSansSC-MediumItalic },
- BoldItalicFeatures = { SmallCapsFont= AlegreyaSansSC-MediumItalic },
]
{AlegreyaSans}
\def\sffamily{\AlegreyaSans}
@@ -277,7 +262,8 @@
\fi
\providecommand\sufigures{\addfontfeatures{VerticalPosition=Superior}}
- \providecommand\infigures{\addfontfeatures{VerticalPosition=ScientificInferior}}
+ \providecommand\infigures{\addfontfeatures{VerticalPosition=Inferior}}
+
\else % type1
@@ -312,11 +298,12 @@
\fi
\fi
+
\DeclareTextFontCommand{\textsu}{\sufigures}
\DeclareTextFontCommand{\textin}{\infigures}
% turn off defaults in case other fonts are selected:
-\ifAlegreyaSans@ttf
+\ifAlegreyaSans@otf
\defaultfontfeatures{}
\fi