summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/cabin/cabin.sty
blob: d410355e915bd39d6f685b5c40b2f7ab53f5d7e1 (plain)
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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{cabin}
    [2012/11/09 (Bob Tennent and autoinst)  Style file for Cabin.]

\RequirePackage{ifxetex,ifluatex,textcomp}

\newif\ifcabin@otf 
\ifxetex
  \RequirePackage{fontspec}
  \cabin@otftrue
\else\ifluatex
  \RequirePackage{fontspec}
  \cabin@otftrue
\else  % [pdf]LaTeX
  \RequirePackage{fontenc,fontaxes}
  \cabin@otffalse
\fi\fi

\newcommand*{\Cabin@scale}{1}
\RequirePackage{xkeyval}
\DeclareOptionX{scaled}{\renewcommand*{\Cabin@scale}{#1}}
\DeclareOptionX{scale}{\renewcommand*{\Cabin@scale}{#1}}

\newif\ifcabin@default \cabin@defaultfalse
\DeclareOptionX{sfdefault}{\cabin@defaulttrue}

\ifcabin@otf
  \DeclareOptionX{semibold}{\edef\cabin@boldstyle{SemiBold}}
  \DeclareOptionX{bold}{\edef\cabin@boldstyle{Bold}}
  \DeclareOptionX{medium}{\edef\cabin@regstyle{Medium}}
  \DeclareOptionX{regular}{\edef\cabin@regstyle{Regular}}
\else % type1
  \DeclareOptionX{semibold}{\renewcommand*{\bfdefault}{sb}}
  \DeclareOptionX{bold}{\renewcommand*{\bfdefault}{b}}
  \DeclareOptionX{medium}{\renewcommand*{\mddefault}{mb}}
  \DeclareOptionX{regular}{\renewcommand*{\mddefault}{m}}
\fi
\ExecuteOptionsX{bold,regular}
\ProcessOptionsX\relax

\ifcabin@otf
  \ifxetex\XeTeXtracingfonts=1\fi
  \defaultfontfeatures{
        Ligatures = TeX ,
        Scale     = \Cabin@scale ,
        Extension = .otf }
  \setsansfont
      [ UprightFont    = *-\cabin@regstyle ,
        ItalicFont     = *-\cabin@regstyle Italic ,
        BoldFont       = *-\cabin@boldstyle , 
        BoldItalicFont = *-\cabin@boldstyle Italic ]
      {Cabin}
  \ifcabin@default
    \setmainfont
        [ UprightFont    = *-\cabin@regstyle ,
          ItalicFont     = *-\cabin@regstyle Italic ,
          BoldFont       = *-\cabin@boldstyle , 
          BoldItalicFont = *-\cabin@boldstyle Italic ]
        {Cabin}
  \fi
\else % type1
  \renewcommand*\sfdefault{Cabin-TLF}
  \ifcabin@default
    \renewcommand*\familydefault{Cabin-TLF}
  \fi
\fi


\endinput