\ProvidesPackage{AlegreyaSans}[% 2016/09/15 (Bob Tennent) Supports AlegreyaSans and AlegreyaSansSC fonts for all LaTeX engines. ] \RequirePackage{ifxetex,ifluatex,textcomp} \newif\ifAlegreyaSans@ttf \ifxetex \AlegreyaSans@ttftrue \else\ifluatex \AlegreyaSans@ttftrue \else % [pdf]LaTeX \AlegreyaSans@ttffalse \fi\fi \RequirePackage{xkeyval} \newcommand*{\AlegreyaSans@scale}{1} \DeclareOptionX{scaled}{\renewcommand*{\AlegreyaSans@scale}{#1}} \DeclareOptionX{scale}{\renewcommand*{\AlegreyaSans@scale}{#1}} \DeclareOptionX{type1}{\AlegreyaSans@ttffalse} \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 \else \AlegreyaSans@liningfalse \fi } \DeclareOptionX{lf}[true]{% \@nameuse{if#1}% \AlegreyaSans@liningtrue \else \AlegreyaSans@liningfalse \fi } \DeclareOptionX{oldstyle}[true]{% \@nameuse{if#1}% \AlegreyaSans@liningfalse \else \AlegreyaSans@liningtrue \fi } \DeclareOptionX{osf}[true]{% \@nameuse{if#1}% \AlegreyaSans@liningfalse \else \AlegreyaSans@liningtrue \fi } \DeclareOptionX{tabular}[true]{% \@nameuse{if#1}% \AlegreyaSans@tabulartrue \else \AlegreyaSans@tabularfalse \fi } \DeclareOptionX{tf}[true]{% \@nameuse{if#1}% \AlegreyaSans@tabulartrue \else \AlegreyaSans@tabularfalse \fi } \DeclareOptionX{proportional}[true]{% \@nameuse{if#1}% \AlegreyaSans@tabularfalse \else \AlegreyaSans@tabulartrue \fi } \DeclareOptionX{pf}[true]{% \@nameuse{if#1}% \AlegreyaSans@tabularfalse \else \AlegreyaSans@tabulartrue \fi } \def\bfseries@sf{b}\def\AlegreyaSans@boldstyle{Bold} \DeclareOptionX{black}{\edef\bfseries@sf{k}\edef\AlegreyaSans@boldstyle{Black}} \DeclareOptionX{extrabold}{\edef\bfseries@sf{eb}\edef\AlegreyaSans@boldstyle{ExtraBold}} \def\mdseries@sf{m}\def\AlegreyaSans@regularstyle{Regular} \DeclareOptionX{thin}{\edef\mdseries@sf{t}\edef\AlegreyaSans@regularstyle{Thin}} \DeclareOptionX{light}{\edef\mdseries@sf{l}\edef\AlegreyaSans@regularstyle{Light}} \DeclareOptionX{medium}{\edef\mdseries@sf{mb}\edef\AlegreyaSans@regularstyle{Medium}} \ProcessOptionsX\relax \ifAlegreyaSans@ttf \ifAlegreyaSans@lining \def\AlegreyaSans@figurestyle{Lining} \else \def\AlegreyaSans@figurestyle{OldStyle} \fi \ifAlegreyaSans@tabular \def\AlegreyaSans@figurealign{Monospaced} \else \def\AlegreyaSans@figurealign{Proportional} \fi \else % type1 \ifAlegreyaSans@lining \def\AlegreyaSans@figurestyle{LF} \else \def\AlegreyaSans@figurestyle{OsF} \fi \ifAlegreyaSans@tabular \def\AlegreyaSans@figurealign{T} \else \def\AlegreyaSans@figurealign{} \fi \fi \ifAlegreyaSans@ttf \RequirePackage{fontspec} \else \RequirePackage{fontenc,fontaxes,mweights} \fi \ifAlegreyaSans@ttf \ifxetex\XeTeXtracingfonts=1\fi \defaultfontfeatures{ Ligatures = TeX , Extension = .ttf , Scale = \AlegreyaSans@scale , } \setsansfont [ 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 }, ] {AlegreyaSans} % grab current family in case of subsequent change: \let\AlegreyaSansfamily\sfdefault \newfontfamily\AlegreyaSans [ 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 }, ] {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 }, ] {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 }, ] {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 }, ] {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 }, ] {AlegreyaSans} \newfontfamily\AlegreyaSansBlack [ Numbers = {\AlegreyaSans@figurealign,\AlegreyaSans@figurestyle}, UprightFont = *-Black , 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 [ Numbers = {\AlegreyaSans@figurealign,\AlegreyaSans@figurestyle}, UprightFont = *-ExtraBold , 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 [ Numbers = {\AlegreyaSans@figurealign,\AlegreyaSans@figurestyle}, UprightFont = *-Thin , 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 [ Numbers = {\AlegreyaSans@figurealign,\AlegreyaSans@figurestyle}, UprightFont = *-Light , 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 [ Numbers = {\AlegreyaSans@figurealign,\AlegreyaSans@figurestyle}, UprightFont = *-Medium , 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} \ifAlegreyaSans@default \edef\familydefault{\AlegreyaSansfamily} \fi \providecommand\sufigures{\addfontfeatures{VerticalPosition=Superior}} \providecommand\infigures{\addfontfeatures{VerticalPosition=ScientificInferior}} \else % type1 \def\AlegreyaSansfamily{AlegreyaSans-\AlegreyaSans@figurealign \AlegreyaSans@figurestyle} \def\AlegreyaSans{\fontfamily{\AlegreyaSansfamily}\selectfont} \def\AlegreyaSansLF{\fontfamily{AlegreyaSans-LF}\selectfont} \def\AlegreyaSansOsF{\fontfamily{AlegreyaSans-OsF}\selectfont} \def\AlegreyaSansTLF{\fontfamily{AlegreyaSans-TLF}\selectfont} \def\AlegreyaSansTOsF{\fontfamily{AlegreyaSans-TOsF}\selectfont} \def\AlegreyaSansThin{\fontfamily{\AlegreyaSansfamily}\fontseries{t}\selectfont} \def\AlegreyaSansLight{\fontfamily{\AlegreyaSansfamily}\fontseries{l}\selectfont} \def\AlegreyaSansMedium{\fontfamily{\AlegreyaSansfamily}\fontseries{mb}\selectfont} \def\AlegreyaSansExtraBold{\fontfamily{\AlegreyaSansfamily}\fontseries{eb}\selectfont} \def\AlegreyaSansBlack{\fontfamily{\AlegreyaSansfamily}\fontseries{k}\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} \providecommand\infigures{\@nomath\infigures\fontfigurestyle{inferior}\selectfont} \def\sfdefault{\AlegreyaSansfamily} \def\sffamily{% \fontfamily{\AlegreyaSansfamily}\selectfont \edef\seriesdefault{\mdseries@sf}% } \ifAlegreyaSans@default \edef\familydefault{\sfdefault} \edef\seriesdefault{\mdseries@sf} \fi \fi \DeclareTextFontCommand{\textsu}{\sufigures} \DeclareTextFontCommand{\textin}{\infigures} % turn off defaults in case other fonts are selected: \ifAlegreyaSans@ttf \defaultfontfeatures{} \fi \endinput