summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/alegreya/AlegreyaSans.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-01-14 00:08:21 +0000
committerKarl Berry <karl@freefriends.org>2014-01-14 00:08:21 +0000
commitd9f2f95abb5f9a133d4c109fbdbcfed3296cf951 (patch)
tree1cc36094a71fa2f7611146bc9eece137f8ea75fb /Master/texmf-dist/tex/latex/alegreya/AlegreyaSans.sty
parent688bb477ee3aa0a6f36b30647af7dd6f366e5225 (diff)
alegreya 2014-01-10 (13jan14)
git-svn-id: svn://tug.org/texlive/trunk@32660 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.sty282
1 files changed, 282 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/alegreya/AlegreyaSans.sty b/Master/texmf-dist/tex/latex/alegreya/AlegreyaSans.sty
new file mode 100644
index 00000000000..8c9c4472c21
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/alegreya/AlegreyaSans.sty
@@ -0,0 +1,282 @@
+\ProvidesPackage{AlegreyaSans}[%
+ 2014/01/10 (Bob Tennent) Supports AlegreyaSans and AlegreyaSansSC fonts for all LaTeX engines. ]
+
+\RequirePackage{ifxetex,ifluatex,textcomp}
+
+\newif\ifAlegreyaSans@otf
+\ifxetex
+ \AlegreyaSans@otftrue
+\else\ifluatex
+ \AlegreyaSans@otftrue
+\else % [pdf]LaTeX
+ \AlegreyaSans@otffalse
+\fi\fi
+
+
+\RequirePackage{xkeyval}
+\newcommand*{\AlegreyaSans@scale}{1}
+\DeclareOptionX{scaled}{\renewcommand*{\AlegreyaSans@scale}{#1}}
+\DeclareOptionX{scale}{\renewcommand*{\AlegreyaSans@scale}{#1}}
+
+\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
+\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@otf
+ \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@otf
+ \RequirePackage{fontspec}
+\else
+ \RequirePackage{fontenc,fontaxes,mweights}
+\fi
+
+\ifAlegreyaSans@otf
+ \ifxetex\XeTeXtracingfonts=1\fi
+ \defaultfontfeatures{
+ Ligatures = TeX ,
+ Extension = .otf ,
+ Scale = \AlegreyaSans@scale ,
+ }
+ \setsansfont
+ [ Numbers = {\AlegreyaSans@figurealign,\AlegreyaSans@figurestyle},
+ UprightFont = *-\AlegreyaSans@regularstyle ,
+ ItalicFont = *-\AlegreyaSans@regularstyle Italic ,
+ BoldFont = *-\AlegreyaSans@boldstyle ,
+ BoldItalicFont = *-\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 ]
+ {AlegreyaSans}
+ \newfontfamily\AlegreyaSansOsF
+ [ Numbers = {Proportional,OldStyle},
+ UprightFont = *-\AlegreyaSans@regularstyle ,
+ ItalicFont = *-\AlegreyaSans@regularstyle Italic ,
+ 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 ]
+ {AlegreyaSans}
+ \newfontfamily\AlegreyaSansTOsF
+ [ Numbers = {Monospaced,OldStyle},
+ UprightFont = *-\AlegreyaSans@regularstyle ,
+ ItalicFont = *-\AlegreyaSans@regularstyle Italic ,
+ BoldFont = *-\AlegreyaSans@boldstyle ,
+ BoldItalicFont = *-\AlegreyaSans@boldstyle Italic ]
+ {AlegreyaSans}
+ \newfontfamily\AlegreyaSansTLF
+ [ Numbers = {Monospaced,Lining},
+ UprightFont = *-\AlegreyaSans@regularstyle ,
+ ItalicFont = *-\AlegreyaSans@regularstyle Italic ,
+ BoldFont = *-\AlegreyaSans@boldstyle ,
+ BoldItalicFont = *-\AlegreyaSans@boldstyle Italic ]
+ {AlegreyaSans}
+ \newfontfamily\AlegreyaSansBlack
+ [ Numbers = {\AlegreyaSans@figurealign,\AlegreyaSans@figurestyle},
+ UprightFont = *-Black ,
+ ItalicFont = *-BlackItalic ,
+ BoldFont = *-Black ,
+ BoldItalicFont = *-BlackItalic ]
+ {AlegreyaSans}
+ \newfontfamily\AlegreyaSansExtraBold
+ [ Numbers = {\AlegreyaSans@figurealign,\AlegreyaSans@figurestyle},
+ UprightFont = *-ExtraBold ,
+ ItalicFont = *-ExtraBoldItalic ,
+ BoldFont = *-ExtraBold ,
+ BoldItalicFont = *-ExtraBoldItalic ]
+ {AlegreyaSans}
+ \newfontfamily\AlegreyaSansThin
+ [ Numbers = {\AlegreyaSans@figurealign,\AlegreyaSans@figurestyle},
+ UprightFont = *-Thin ,
+ ItalicFont = *-ThinItalic ,
+ BoldFont = *-Thin ,
+ BoldItalicFont = *-ThinItalic ]
+ {AlegreyaSans}
+ \newfontfamily\AlegreyaSansLight
+ [ Numbers = {\AlegreyaSans@figurealign,\AlegreyaSans@figurestyle},
+ UprightFont = *-Light ,
+ ItalicFont = *-LightItalic ,
+ BoldFont = *-Light ,
+ BoldItalicFont = *-LightItalic ]
+ {AlegreyaSans}
+ \newfontfamily\AlegreyaSansMedium
+ [ Numbers = {\AlegreyaSans@figurealign,\AlegreyaSans@figurestyle},
+ UprightFont = *-Medium ,
+ ItalicFont = *-MediumItalic ,
+ BoldFont = *-Medium ,
+ BoldItalicFont = *-MediumItalic ]
+ {AlegreyaSans}
+ \newfontfamily\AlegreyaSansSC
+ [ Numbers = {\AlegreyaSans@figurealign,\AlegreyaSans@figurestyle},
+ UprightFont = *-\AlegreyaSans@regularstyle ,
+ ItalicFont = *-\AlegreyaSans@regularstyle Italic ,
+ BoldFont = *-\AlegreyaSans@boldstyle ,
+ BoldItalicFont = *-\AlegreyaSans@boldstyle Italic ]
+ {AlegreyaSansSC}
+ \def\sffamily{\AlegreyaSans\def\scshape{\AlegreyaSansSC}}
+ \ifAlegreyaSans@default
+ \edef\familydefault{\AlegreyaSansfamily}
+ \def\scshape{\AlegreyaSansSC}
+ \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}
+
+ \def\AlegreyaSansSCfamily{AlegreyaSansSC-\AlegreyaSans@figurealign \AlegreyaSans@figurestyle}
+ \def\AlegreyaSansSC{\fontfamily{\AlegreyaSansSCfamily}\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}
+ \def\scshape{\fontfamily{\AlegreyaSansSCfamily}\selectfont}
+ }
+ \ifAlegreyaSans@default
+ \edef\familydefault{\sfdefault}
+ \edef\seriesdefault{\mdseries@sf}
+ \def\scshape{\fontfamily{\AlegreyaSansSCfamily}\selectfont}
+ \fi
+
+\fi
+\DeclareTextFontCommand{\textsu}{\sufigures}
+\DeclareTextFontCommand{\textin}{\infigures}
+
+% turn off defaults in case other fonts are selected:
+\ifAlegreyaSans@otf
+ \defaultfontfeatures{}
+\fi
+
+\endinput
+