diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/sourcesanspro/SourceSansPro-otf.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/sourcesanspro/SourceSansPro-otf.sty | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/sourcesanspro/SourceSansPro-otf.sty b/Master/texmf-dist/tex/latex/sourcesanspro/SourceSansPro-otf.sty new file mode 100644 index 00000000000..c38b6998101 --- /dev/null +++ b/Master/texmf-dist/tex/latex/sourcesanspro/SourceSansPro-otf.sty @@ -0,0 +1,97 @@ +% Source Sans Pro for LaTeX +% +% Silke Hofstra, silke@slxh.nl +% +% Autoinst based file which loads the type1 version of Source Sans Pro +% +% Licenced under the LPPL +% +\NeedsTeXFormat{LaTeX2e}[1994/12/01] +\ProvidesPackage{SourceSansPro-otf}[2012/10/21 v1 Adobe's Souce Sans Pro typeface] + +% Check if engine is XeTeX or LuaTeX +\RequirePackage{expl3}[2011/09/05] +\ExplSyntaxOn +\msg_new:nnn {SourceSansPro-otf} {cannot-use-pdftex} +{ + The~ SourceSansPro-otf~ package~ requires~ either~ XeTeX~ or~ LuaTeX~ to~ function. + \\\\ + You~ must~ change~ your~ typesetting~ engine~ to,~ + e.g.,~ "xelatex"~ or~ "lualatex"\\ + instead~ of~ plain~ "latex"~ or~ "pdflatex". +} +\xetex_if_engine:F { + \luatex_if_engine:TF { + \RequirePackage{luaotfload} + \RequireLuaModule{fontspec} + }{ + \msg_fatal:nn {SourceSansPro-otf} {cannot-use-pdftex} + } +} + +\RequirePackage{fontspec} + +\IfFileExists{xkeyval.sty}{ + \newcommand*{\SourceSansPro@scale}{1} + \RequirePackage{xkeyval} + \DeclareOptionX{scaled}{\renewcommand*{\SourceSansPro@scale}{##1}} +}{ + \let\DeclareOptionX\DeclareOption + \let\ExecuteOptionsX\ExecuteOptions + \let\ProcessOptionsX\ProcessOptions +} + +\DeclareOptionX{lining}{\edef\SourceSansPro@figurestyle{Lining}} +\DeclareOptionX{nf}{\edef\SourceSansPro@figurestyle{Lining}} +\DeclareOptionX{oldstyle}{\edef\SourceSansPro@figurestyle{OldStyle}} +\DeclareOptionX{osf}{\edef\SourceSansPro@figurestyle{OldStyle}} +\DeclareOptionX{tabular}{\edef\SourceSansPro@figurealign{Monospaced}} +\DeclareOptionX{proportional}{\edef\SourceSansPro@figurealign{Proportional}} +\DeclareOptionX{black}{\edef\SourceSansPro@boldstyle{Black}} +\DeclareOptionX{semibold}{\edef\SourceSansPro@boldstyle{Semibold}} +\DeclareOptionX{bold}{\edef\SourceSansPro@boldstyle{Bold}} +\DeclareOptionX{light}{\edef\SourceSansPro@regstyle{Light}} +\DeclareOptionX{extralight}{\edef\SourceSansPro@regstyle{ExtraLight}} +\DeclareOptionX{regular}{\edef\SourceSansPro@regstyle{Regular}} +\DeclareOptionX{default}{\renewcommand*{\familydefault}{\sfdefault}} +\ExecuteOptionsX{lining,proportional,bold,regular} +\ProcessOptionsX\relax + +% Shared features +\defaultfontfeatures{ + Ligatures = TeX , + Numbers = {\SourceSansPro@figurealign , \SourceSansPro@figurestyle } , + Scale = \SourceSansPro@scale , + Extension = .otf } + +% Default font +\setsansfont + [ UprightFont = *-\SourceSansPro@regstyle , + ItalicFont = *-\SourceSansPro@regstyle It , + BoldFont = *-\SourceSansPro@boldstyle , + BoldItalicFont = *-\SourceSansPro@boldstyle It] + {SourceSansPro} + +% Font commands +\newfontfamily\sourcesanspro + [ UprightFont = *-Regular , + ItalicFont = *-RegularIt , + BoldFont = *-Bold , + BoldItalicFont = *-BoldIt ] + {SourceSansPro} + +\newfontfamily\sourcesansprolight + [ UprightFont = *-Light , + ItalicFont = *-LightIt , + BoldFont = *-Semibold , + BoldItalicFont = *-SemiboldIt ] + {SourceSansPro} + +\newfontfamily\sourcesansproextreme + [ UprightFont = *-ExtraLight , + ItalicFont = *-ExtraLightIt , + BoldFont = *-Black , + BoldItalicFont = *-BlackIt ] + {SourceSansPro} + +\endinput
\ No newline at end of file |