1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{cabin}
[2013/06/22 (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
% now using \ifcabin@semibold and \ifcabin@medium in .fd files
\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
|