\NeedsTeXFormat{LaTeX2e} \ProvidesPackage{cabin} [2012/11/13 (Bob Tennent) Supports Cabin fonts for all LaTeX engines.] \RequirePackage{ifxetex,ifluatex,xkeyval,textcomp} \newif\ifcabin@otf \ifxetex \cabin@otftrue \else\ifluatex \cabin@otftrue \else % [pdf]LaTeX \cabin@otffalse \fi\fi \newif\ifcabin@default \cabin@defaultfalse \newif\ifcabin@lining \cabin@liningfalse \newif\ifcabin@tabular \cabin@tabularfalse \newif\ifcabin@semibold \cabin@semiboldfalse \newif\ifcabin@medium \cabin@mediumfalse \newif\ifcabin@condensed \cabin@condensedfalse \newcommand*{\Cabin@scale}{1} \DeclareOptionX{scaled}{\renewcommand*{\Cabin@scale}{#1}} \DeclareOptionX{scale}{\renewcommand*{\Cabin@scale}{#1}} \DeclareOptionX{default}{\cabin@defaulttrue} \DeclareOptionX{sfdefault}{\cabin@defaulttrue} \DeclareOptionX{type1}{\cabin@otffalse} \DeclareOptionX{semibold}{\cabin@semiboldtrue} \DeclareOptionX{bold}{\cabin@semiboldfalse} \DeclareOptionX{medium}{\cabin@mediumtrue} \DeclareOptionX{regular}{\cabin@mediumfalse} \DeclareOptionX{condensed}{\cabin@condensedtrue} \ExecuteOptionsX{bold,regular} \ProcessOptionsX\relax \ifcabin@otf \ifcabin@semibold \edef\cabin@boldstyle{SemiBold} \else \edef\cabin@boldstyle{Bold} \fi \ifcabin@medium \edef\cabin@regstyle{Medium} \else \edef\cabin@regstyle{Regular} \fi \else % type1 \ifcabin@semibold \renewcommand*{\bfdefault}{sb} \else \renewcommand*{\bfdefault}{b} \fi \ifcabin@medium \renewcommand*{\mddefault}{mb} \else \renewcommand*{\mddefault}{m} \fi \fi \ifcabin@otf \RequirePackage{fontspec} \else \RequirePackage{fontenc,fontaxes} \fi \ifcabin@otf \ifxetex\XeTeXtracingfonts=1\fi \defaultfontfeatures{ Ligatures = TeX , Scale = \Cabin@scale , Extension = .otf } \ifcabin@condensed \setsansfont [ UprightFont = *-\cabin@regstyle , ItalicFont = *-\cabin@regstyle Italic , BoldFont = *-\cabin@boldstyle , BoldItalicFont = *-\cabin@boldstyle Italic ] {CabinCondensed} \else \setsansfont [ UprightFont = *-\cabin@regstyle , ItalicFont = *-\cabin@regstyle Italic , BoldFont = *-\cabin@boldstyle , BoldItalicFont = *-\cabin@boldstyle Italic ] {Cabin} \fi % grab current family in case of subsequent change: \let\cabinfamily\sfdefault \ifcabin@default\renewcommand*\familydefault{\cabinfamily}\fi \newfontfamily\cabin [ UprightFont = *-\cabin@regstyle , ItalicFont = *-\cabin@regstyle Italic , BoldFont = *-\cabin@boldstyle , BoldItalicFont = *-\cabin@boldstyle Italic ] {Cabin} \newfontfamily\cabincondensed [ UprightFont = *-\cabin@regstyle , ItalicFont = *-\cabin@regstyle Italic , BoldFont = *-\cabin@boldstyle , BoldItalicFont = *-\cabin@boldstyle Italic ] {CabinCondensed} \else % type1 \def\cabinfamily{Cabin-TLF} \def\cabincondensedfamily{CabinCondensed-TLF} \ifcabin@condensed \renewcommand*\sfdefault{\cabincondensedfamily} \ifcabin@default\renewcommand*\familydefault{\cabincondensedfamily}\fi \else \renewcommand*\sfdefault{\cabinfamily} \ifcabin@default\renewcommand*\familydefault{\cabinfamily}\fi \fi \newcommand*\cabin{\fontfamily{\cabinfamily}\selectfont} \newcommand*\cabincondensed{\fontfamily{\cabincondensedfamily}\selectfont} \fi % turn off defaults in case other fonts are selected: \ifcabin@otf \defaultfontfeatures{} \fi \endinput