summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/chivo/Chivo.sty
blob: bfc7b0fdbd5154bb7f784c3d4db0c252fcdc9215 (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
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
119
120
121
122
123
124
125
126
127
128
129
130
%%
%% This is file `Chivo.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% Chivo.dtx  (with options: `package')
%% 
%% Copyright (C) 2016 Arash Esbati <esbati'at'gmx.de>
%% 
%% This work may be distributed and/or modified under the conditions
%% of the LaTeX Project Public License (LPPL), either version 1.3c of
%% this license or (at your option) any later version.  The latest
%% version of this license is in the file:
%% 
%%    http://www.latex-project.org/lppl.txt
%% 
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{Chivo}
  [2016/05/05 v1.0 Support for Chivo fonts (AE)]
\newif\ifChivo@otf
\ifdefined\XeTeXinterchartoks % we are in XeTeX
  \Chivo@otftrue
\else
  \ifdefined\directlua        % we are in LuaTeX
    \Chivo@otftrue
  \fi
\fi
\ifChivo@otf
  \RequirePackage{fontspec}
\else
  \RequirePackage{mweights}
\fi
\RequirePackage{kvoptions}
\SetupKeyvalOptions{%
  family = Chivo  ,
  prefix = Chivo@
}
\DeclareBoolOption{regular}
\DeclareComplementaryOption{light}{regular}
\DeclareBoolOption{bold}
\DeclareComplementaryOption{black}{bold}
\ifChivo@otf
  \DeclareVoidOption{scale}{\relax}
\else
  \DeclareStringOption[1.0]{scale}
\fi
\DeclareBoolOption{familydefault}
\DeclareVoidOption{opentype}{\Chivo@otftrue}
\DeclareVoidOption{type1}{\Chivo@otffalse}
\setkeys{Chivo}{regular,bold}
\ProcessKeyvalOptions{Chivo}
\ifChivo@otf \else
  \ifChivo@regular
    \def\mdseries@sf{m}
  \else
    \def\mdseries@sf{l}
  \fi
\fi
\ifChivo@otf \else
  \ifChivo@bold
    \def\bfseries@sf{b}
  \else
    \def\bfseries@sf{k}
  \fi
\fi
\ifChivo@otf
  \ifChivo@regular
    \ifChivo@bold
      \defaultfontfeatures[Chivo]
        {
          Extension      = .otf              ,
          BoldFont       = Chivo-Bold        ,
          ItalicFont     = Chivo-Italic      ,
          BoldItalicFont = Chivo-BoldItalic  ,
          UprightFont    = Chivo-Regular
        }
    \else
      \defaultfontfeatures[Chivo]
        {
          Extension      = .otf              ,
          BoldFont       = Chivo-Black       ,
          ItalicFont     = Chivo-Italic      ,
          BoldItalicFont = Chivo-BlackItalic ,
          UprightFont    = Chivo-Regular
        }
    \fi
  \else
    \ifChivo@bold
      \defaultfontfeatures[Chivo]
        {
          Extension      = .otf              ,
          BoldFont       = Chivo-Bold        ,
          ItalicFont     = Chivo-LightItalic ,
          BoldItalicFont = Chivo-BoldItalic  ,
          UprightFont    = Chivo-Light
        }
    \else
      \defaultfontfeatures[Chivo]
        {
          Extension      = .otf              ,
          BoldFont       = Chivo-Black       ,
          ItalicFont     = Chivo-LightItalic ,
          BoldItalicFont = Chivo-BlackItalic ,
          UprightFont    = Chivo-Light
        }
    \fi
  \fi
\fi
\ifChivo@otf
  \AtBeginDocument{%
    \setsansfont{Chivo}%
  }
\else
  \renewcommand*{\sfdefault}{Chivo-TLF}
\fi
\ifChivo@familydefault
  \renewcommand*{\familydefault}{\sfdefault}
  \ifChivo@otf\else
    \ifChivo@regular \else
      \edef\seriesdefault{\mdseries@sf}
    \fi
    \ifChivo@bold \else
      \edef\bfdefault{\bfseries@sf}
    \fi
  \fi
\fi
\endinput
%%
%% End of file `Chivo.sty'.