summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/cabin/cabin-otf.sty
blob: 1d6a2fe8009204e6ca97cb633e9af492178ab04b (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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{cabin-otf}
    [2012/10/31 (autoinst)  Style file for Cabin when using LuaLaTeX or XeLatex.]
\RequirePackage{ifxetex,ifluatex}
\ifxetex
   % okay
  \XeTeXtracingfonts=1\relax
\else
   \ifluatex
      % okay
   \else
      \PackageError{cabin-otf}{runs only with xelatex and lualatex!}{}
   \fi
\fi


\RequirePackage{textcomp}
\IfFileExists{fontaxes.sty}{
    \RequirePackage{fontaxes}
}{}

\IfFileExists{xkeyval.sty}{
    \newcommand*{\Cabin@scale}{1}
    \RequirePackage{xkeyval}
    \DeclareOptionX{scaled}{\renewcommand*{\Cabin@scale}{##1}}
}{
    \let\DeclareOptionX\DeclareOption
    \let\ExecuteOptionsX\ExecuteOptions
    \let\ProcessOptionsX\ProcessOptions
}


\DeclareOptionX{semibold}{\edef\Cabin@boldstyle{SemiBold}}
\DeclareOptionX{bold}{\edef\Cabin@boldstyle{Bold}}
\DeclareOptionX{medium}{\edef\Cabin@regstyle{Medium}}
\DeclareOptionX{regular}{\edef\Cabin@regstyle{Regular}}
\ExecuteOptionsX{bold,regular}
\ProcessOptionsX\relax

\RequirePackage{fontspec}
\defaultfontfeatures{
      Ligatures = TeX ,
      Scale     = \Cabin@scale ,
      Extension = .otf }

% Default font
\setsansfont
        [ UprightFont    = *-\Cabin@regstyle ,
          ItalicFont     = *-\Cabin@regstyle Italic ,
          BoldFont       = *-\Cabin@boldstyle , 
          BoldItalicFont = *-\Cabin@boldstyle Italic ]
        {Cabin}

\endinput