summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/sourcecodepro/sourcecodepro-otf.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/sourcecodepro/sourcecodepro-otf.sty')
-rw-r--r--Master/texmf-dist/tex/latex/sourcecodepro/sourcecodepro-otf.sty97
1 files changed, 97 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/sourcecodepro/sourcecodepro-otf.sty b/Master/texmf-dist/tex/latex/sourcecodepro/sourcecodepro-otf.sty
new file mode 100644
index 00000000000..e3674aefa4d
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/sourcecodepro/sourcecodepro-otf.sty
@@ -0,0 +1,97 @@
+% Source Code Pro for LaTeX
+%
+% Silke Hofstra, silke@slxh.nl
+%
+% Autoinst based file which loads the type1 version of Source Code Pro
+%
+% Licenced under the LPPL
+%
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesPackage{sourcecodepro-otf}[2012/10/31 v1.01 Adobe's Source Code Pro typeface]
+
+% Check if engine is XeTeX or LuaTeX
+\RequirePackage{expl3}[2011/09/05]
+\ExplSyntaxOn
+\msg_new:nnn {sourcecodepro-otf} {cannot-use-pdftex}
+{
+ The~ sourcecodepro-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 {sourcecodepro-otf} {cannot-use-pdftex}
+ }
+}
+
+\RequirePackage{fontspec}
+
+\IfFileExists{xkeyval.sty}{
+ \newcommand*{\sourcecodepro@scale}{1}
+ \RequirePackage{xkeyval}
+ \DeclareOptionX{scaled}{\renewcommand*{\sourcecodepro@scale}{##1}}
+}{
+ \let\DeclareOptionX\DeclareOption
+ \let\ExecuteOptionsX\ExecuteOptions
+ \let\ProcessOptionsX\ProcessOptions
+}
+
+\DeclareOptionX{lining}{\edef\sourcecodepro@figurestyle{Lining}}
+\DeclareOptionX{nf}{\edef\sourcecodepro@figurestyle{Lining}}
+\DeclareOptionX{oldstyle}{\edef\sourcecodepro@figurestyle{OldStyle}}
+\DeclareOptionX{osf}{\edef\sourcecodepro@figurestyle{OldStyle}}
+\DeclareOptionX{tabular}{\edef\sourcecodepro@figurealign{Monospaced}}
+\DeclareOptionX{proportional}{\edef\sourcecodepro@figurealign{Proportional}}
+\DeclareOptionX{black}{\edef\sourcecodepro@boldstyle{Black}}
+\DeclareOptionX{semibold}{\edef\sourcecodepro@boldstyle{Semibold}}
+\DeclareOptionX{bold}{\edef\sourcecodepro@boldstyle{Bold}}
+\DeclareOptionX{light}{\edef\sourcecodepro@regstyle{Light}}
+\DeclareOptionX{extralight}{\edef\sourcecodepro@regstyle{ExtraLight}}
+\DeclareOptionX{regular}{\edef\sourcecodepro@regstyle{Regular}}
+\DeclareOptionX{default}{\renewcommand*{\familydefault}{\ttdefault}}
+\ExecuteOptionsX{lining,proportional,bold,regular}
+\ProcessOptionsX\relax
+
+% Shared features
+\defaultfontfeatures{
+ Ligatures = TeX ,
+ Numbers = {\sourcecodepro@figurealign , \sourcecodepro@figurestyle } ,
+ Scale = \sourcecodepro@scale ,
+ Extension = .otf }
+
+% Default font
+\setmonofont
+ [ UprightFont = *-\sourcecodepro@regstyle ,
+ ItalicFont = *-\sourcecodepro@regstyle ,
+ BoldFont = *-\sourcecodepro@boldstyle ,
+ BoldItalicFont = *-\sourcecodepro@boldstyle ]
+ {SourceCodePro}
+
+% Font commands
+\newfontfamily\sourcecodepro
+ [ UprightFont = *-Regular ,
+ ItalicFont = *-Regular ,
+ BoldFont = *-Bold ,
+ BoldItalicFont = *-Bold ]
+ {SourceCodePro}
+
+\newfontfamily\sourcecodeprolight
+ [ UprightFont = *-Light ,
+ ItalicFont = *-Light ,
+ BoldFont = *-Semibold ,
+ BoldItalicFont = *-Semibold ]
+ {SourceCodePro}
+
+\newfontfamily\sourcecodeproextreme
+ [ UprightFont = *-ExtraLight ,
+ ItalicFont = *-ExtraLight ,
+ BoldFont = *-Black ,
+ BoldItalicFont = *-Black ]
+ {SourceCodePro}
+
+\endinput \ No newline at end of file