summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/roboto/roboto.sty
blob: 7cf03f8a7982fdce3e47657b37f4429e9d37323a (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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{roboto}
    [2019/03/01 (Bob Tennent)  Supports Roboto fonts for all LaTeX engines.]

\RequirePackage{ifxetex,ifluatex,xkeyval,textcomp}

\newif\ifroboto@otf 
\ifxetex
  \roboto@otftrue
\else\ifluatex
  \roboto@otftrue
\else  % [pdf]LaTeX
  \roboto@otffalse
\fi\fi

\newif\ifroboto@lining \roboto@liningfalse
\newif\ifroboto@tabular \roboto@tabularfalse
\newif\ifroboto@default \roboto@defaultfalse

\newcommand*{\Roboto@scale}{1}
\newcommand*{\RobotoCondensed@scale}{1}
\DeclareOptionX{scaled}{\renewcommand*{\Roboto@scale}{#1}\renewcommand*{\RobotoCondensed@scale}{#1}}
\DeclareOptionX{scale}{\renewcommand*{\Roboto@scale}{#1}\renewcommand*{\RobotoCondensed@scale}{#1}}

\newif\ifroboto@light \roboto@lightfalse
\newif\ifroboto@thin \roboto@thinfalse
\newif\ifroboto@medium \roboto@mediumfalse
\newif\ifroboto@black \roboto@blackfalse
\newif\ifroboto@condensed \roboto@condensedfalse
\newif\ifroboto@slab  \roboto@slabfalse

\DeclareOptionX{default}{\roboto@defaulttrue}
\DeclareOptionX{sfdefault}{\roboto@defaulttrue}
\DeclareOptionX{type1}{\roboto@otffalse}
\DeclareOptionX{medium}{\roboto@mediumtrue\roboto@blackfalse}
\DeclareOptionX{bold}{\roboto@blackfalse\roboto@mediumfalse}
\DeclareOptionX{black}{\roboto@blacktrue\roboto@mediumfalse}
\DeclareOptionX{thin}{\roboto@thintrue\roboto@lightfalse}
\DeclareOptionX{light}{\roboto@lighttrue\roboto@thinfalse}
\DeclareOptionX{regular}{\roboto@lightfalse\roboto@thinfalse}
\DeclareOptionX{condensed}{\roboto@condensedtrue\roboto@thinfalse}
\DeclareOptionX{rm}{\roboto@slabtrue}
\DeclareOptionX{lining}{\roboto@liningtrue}
\DeclareOptionX{nf}{\roboto@liningtrue}
\DeclareOptionX{lf}{\roboto@liningtrue}
\DeclareOptionX{oldstyle}{\roboto@liningfalse}
\DeclareOptionX{osf}{\roboto@liningfalse}
\DeclareOptionX{tabular}{\roboto@tabulartrue}
\DeclareOptionX{t}{\roboto@tabulartrue}
\DeclareOptionX{proportional}{\roboto@tabularfalse}
\DeclareOptionX{p}{\roboto@tabularfalse}


\ExecuteOptionsX{bold,regular,lining,proportional}
\ProcessOptionsX\relax

\ifroboto@otf
  \def\roboto@boldstyle{Bold}
  \ifroboto@medium\def\roboto@boldstyle{Medium}\fi
  \ifroboto@black\def\roboto@boldstyle{Black}\fi
  \def\roboto@regstyle{Regular}
  \ifroboto@light\def\roboto@regstyle{Light}\fi
  \ifroboto@thin\def\roboto@regstyle{Thin}\fi

\else % type1

  \def\bfseries@sf{b}
  \ifroboto@medium\def\bfseries@sf{mb}\fi
  \ifroboto@black\def\bfseries@sf{k}\fi
  \def\mdseries@sf{m}
  \ifroboto@thin\def\mdseries@sf{t}
     \ifroboto@slab\def\mdseries@rm{t}\fi\fi
  \ifroboto@light\def\mdseries@sf{l}
     \ifroboto@slab\def\mdseries@rm{l}\fi\fi
  \def\seriesdefault{\mdseries@rm}

\fi

\ifroboto@otf
  \ifroboto@lining
    \def\roboto@figurestyle{Lining}
  \else
    \def\roboto@figurestyle{OldStyle} 
  \fi
  \ifroboto@tabular
    \def\roboto@figurealign{Monospaced} 
  \else
    \def\roboto@figurealign{Proportional} 
  \fi
\else % type1
  \ifroboto@lining
    \def\roboto@figurestyle{LF}
  \else
    \def\roboto@figurestyle{OsF}
  \fi
  \ifroboto@tabular
    \def\roboto@figurealign{T}
  \else
    \def\roboto@figurealign{}
  \fi
\fi


\ifroboto@otf
  \RequirePackage{fontspec}
\else
  \RequirePackage{fontenc,fontaxes,mweights}
\fi

\ifroboto@otf
  \def\roboto@regular{Regular}
  \ifxetex\XeTeXtracingfonts=1\fi
  \defaultfontfeatures{
        Ligatures = TeX ,
        Scale     = \Roboto@scale ,
        Extension = .ttf }
  \ifroboto@condensed
    \setsansfont
        [ Numbers = {\roboto@figurealign,\roboto@figurestyle},
          UprightFont    = *-\roboto@regstyle ,
          ItalicFont     = *-\ifx\roboto@regstyle\roboto@regular Italic\else\roboto@regstyle Italic\fi,
          BoldFont       = *-Bold ,
          BoldItalicFont = *-BoldItalic ,
          FontFace       = {l}{n}{*-Light},
          FontFace       = {l}{sc}{*-Light},
          FontFace       = {l}{sl}{*-Light},
          FontFace       = {l}{it}{*-LightItalic},
          FontFace       = {m}{n}{*-Regular},
          FontFace       = {m}{sc}{*-Regular},
          FontFace       = {m}{sl}{*-Regular},
          FontFace       = {m}{it}{*-Italic},
          FontFace       = {b}{n}{*-Bold},
          FontFace       = {b}{sc}{*-Bold},
          FontFace       = {b}{sl}{*-Bold},
          FontFace       = {b}{it}{*-BoldItalic} ]
        {RobotoCondensed}
  \else
    \setsansfont
        [ Numbers = {\roboto@figurealign,\roboto@figurestyle},
          UprightFont    = *-\roboto@regstyle ,
          ItalicFont     = *-\ifx\roboto@regstyle\roboto@regular Italic\else\roboto@regstyle Italic\fi,
          BoldFont       = *-\roboto@boldstyle ,
          BoldItalicFont = *-\roboto@boldstyle Italic ,
          FontFace       = {t}{n}{*-Thin},
          FontFace       = {t}{sc}{*-Thin},
          FontFace       = {t}{sl}{*-Thin},
          FontFace       = {t}{it}{*-ThinItalic},
          FontFace       = {l}{n}{*-Light},
          FontFace       = {l}{sc}{*-Light},
          FontFace       = {l}{sl}{*-Light},
          FontFace       = {l}{it}{*-LightItalic},
          FontFace       = {m}{n}{*-Regular},
          FontFace       = {m}{sc}{*-Regular},
          FontFace       = {m}{sl}{*-Regular},
          FontFace       = {m}{it}{*-Italic},
          FontFace       = {mb}{n}{*-Medium},
          FontFace       = {mb}{sc}{*-Medium},
          FontFace       = {mb}{sl}{*-Medium},
          FontFace       = {mb}{it}{*-MediumItalic},
          FontFace       = {b}{n}{*-Bold},
          FontFace       = {b}{sc}{*-Bold},
          FontFace       = {b}{sl}{*-Bold},
          FontFace       = {b}{it}{*-BoldItalic},
          FontFace       = {k}{n}{*-Black},
          FontFace       = {k}{sc}{*-Black},
          FontFace       = {k}{sl}{*-Black},
          FontFace       = {k}{it}{*-BlackItalic} ]
        {Roboto}
  \fi
  % grab current family in case of subsequent change:
  \let\robotofamily\sfdefault  
  \ifroboto@slab
    \setmainfont
        [ UprightFont    = *-\roboto@regstyle ,
          BoldFont       = *-Bold ,
          FontFace       = {t}{n}{*-Thin},
          FontFace       = {t}{sc}{*-Thin},
          FontFace       = {t}{sl}{*-Thin},
          FontFace       = {l}{n}{*-Light},
          FontFace       = {l}{sc}{*-Light},
          FontFace       = {l}{sl}{*-Light},
          FontFace       = {m}{n}{*-Regular},
          FontFace       = {m}{sc}{*-Regular},
          FontFace       = {m}{sl}{*-Regular},
          FontFace       = {b}{n}{*-Bold},
          FontFace       = {b}{sc}{*-Bold},
          FontFace       = {b}{sl}{*-Bold} ]
        {RobotoSlab}
  \fi
  \ifroboto@default\renewcommand*\familydefault{\robotofamily}\fi
  \newfontfamily\roboto
        [ Numbers = {\roboto@figurealign,\roboto@figurestyle},
          UprightFont    = *-\roboto@regstyle ,
          ItalicFont     = *-\ifx\roboto@regstyle\roboto@regular Italic\else\roboto@regstyle Italic\fi,
          BoldFont       = *-\roboto@boldstyle ,
          BoldItalicFont = *-\roboto@boldstyle Italic ,
          FontFace       = {t}{n}{*-Thin},
          FontFace       = {t}{sc}{*-Thin},
          FontFace       = {t}{sl}{*-Thin},
          FontFace       = {t}{it}{*-ThinItalic},
          FontFace       = {l}{n}{*-Light},
          FontFace       = {l}{sc}{*-Light},
          FontFace       = {l}{sl}{*-Light},
          FontFace       = {l}{it}{*-LightItalic},
          FontFace       = {m}{n}{*-Regular},
          FontFace       = {m}{sc}{*-Regular},
          FontFace       = {m}{sl}{*-Regular},
          FontFace       = {m}{it}{*-Italic},
          FontFace       = {mb}{n}{*-Medium},
          FontFace       = {mb}{sc}{*-Medium},
          FontFace       = {mb}{sl}{*-Medium},
          FontFace       = {mb}{it}{*-MediumItalic},
          FontFace       = {b}{n}{*-Bold},
          FontFace       = {b}{sc}{*-Bold},
          FontFace       = {b}{sl}{*-Bold},
          FontFace       = {b}{it}{*-BoldItalic},
          FontFace       = {k}{n}{*-Black},
          FontFace       = {k}{sc}{*-Black},
          FontFace       = {k}{sl}{*-Black},
          FontFace       = {k}{it}{*-BlackItalic} ]
        {Roboto}
  \newfontfamily\robotocondensed
        [ Numbers = {\roboto@figurealign,\roboto@figurestyle},
          UprightFont    = *-\roboto@regstyle ,
          ItalicFont     = *-\ifx\roboto@regstyle\roboto@regular Italic\else\roboto@regstyle Italic\fi,
          BoldFont       = *-Bold ,
          BoldItalicFont = *-BoldItalic ,
          FontFace       = {l}{n}{*-Light},
          FontFace       = {l}{sc}{*-Light},
          FontFace       = {l}{sl}{*-Light},
          FontFace       = {l}{it}{*-LightItalic},
          FontFace       = {m}{n}{*-Regular},
          FontFace       = {m}{sc}{*-Regular},
          FontFace       = {m}{sl}{*-Regular},
          FontFace       = {m}{it}{*-Italic},
          FontFace       = {b}{n}{*-Bold},
          FontFace       = {b}{sc}{*-Bold},
          FontFace       = {b}{sl}{*-Bold},
          FontFace       = {b}{it}{*-BoldItalic} ]
        {RobotoCondensed}
  \newfontfamily\robotoslab
        [ UprightFont    = *-\roboto@regstyle ,
          BoldFont       = *-Bold ,
          FontFace       = {t}{n}{*-Thin},
          FontFace       = {t}{sc}{*-Thin},
          FontFace       = {t}{sl}{*-Thin},
          FontFace       = {l}{n}{*-Light},
          FontFace       = {l}{sc}{*-Light},
          FontFace       = {l}{sl}{*-Light},
          FontFace       = {m}{n}{*-Regular},
          FontFace       = {m}{sc}{*-Regular},
          FontFace       = {m}{sl}{*-Regular},
          FontFace       = {b}{n}{*-Bold},
          FontFace       = {b}{sc}{*-Bold},
          FontFace       = {b}{sl}{*-Bold} ]
        {RobotoSlab}
  \newfontfamily\robotoOsF
        [ Numbers = {\roboto@figurealign,OldStyle},
          UprightFont    = *-\roboto@regstyle ,
          ItalicFont     = *-\ifx\roboto@regstyle\roboto@regular Italic\else\roboto@regstyle Italic\fi,
          BoldFont       = *-\roboto@boldstyle ,
          BoldItalicFont = *-\roboto@boldstyle Italic ,
          FontFace       = {t}{n}{*-Thin},
          FontFace       = {t}{sc}{*-Thin},
          FontFace       = {t}{sl}{*-Thin},
          FontFace       = {t}{it}{*-ThinItalic},
          FontFace       = {l}{n}{*-Light},
          FontFace       = {l}{sc}{*-Light},
          FontFace       = {l}{sl}{*-Light},
          FontFace       = {l}{it}{*-LightItalic},
          FontFace       = {m}{n}{*-Regular},
          FontFace       = {m}{sc}{*-Regular},
          FontFace       = {m}{sl}{*-Regular},
          FontFace       = {m}{it}{*-Italic},
          FontFace       = {mb}{n}{*-Medium},
          FontFace       = {mb}{sc}{*-Medium},
          FontFace       = {mb}{sl}{*-Medium},
          FontFace       = {mb}{it}{*-MediumItalic},
          FontFace       = {b}{n}{*-Bold},
          FontFace       = {b}{sc}{*-Bold},
          FontFace       = {b}{sl}{*-Bold},
          FontFace       = {b}{it}{*-BoldItalic},
          FontFace       = {k}{n}{*-Black},
          FontFace       = {k}{sc}{*-Black},
          FontFace       = {k}{sl}{*-Black},
          FontFace       = {k}{it}{*-BlackItalic} ]
        {Roboto}
  \newfontfamily\robotoLF
        [ Numbers = {\roboto@figurealign,Lining},
          UprightFont    = *-\roboto@regstyle ,
          ItalicFont     = *-\ifx\roboto@regstyle\roboto@regular Italic\else\roboto@regstyle Italic\fi,
          BoldFont       = *-\roboto@boldstyle ,
          BoldItalicFont = *-\roboto@boldstyle Italic ,
          FontFace       = {t}{n}{*-Thin},
          FontFace       = {t}{sc}{*-Thin},
          FontFace       = {t}{sl}{*-Thin},
          FontFace       = {t}{it}{*-ThinItalic},
          FontFace       = {l}{n}{*-Light},
          FontFace       = {l}{sc}{*-Light},
          FontFace       = {l}{sl}{*-Light},
          FontFace       = {l}{it}{*-LightItalic},
          FontFace       = {m}{n}{*-Regular},
          FontFace       = {m}{sc}{*-Regular},
          FontFace       = {m}{sl}{*-Regular},
          FontFace       = {m}{it}{*-Italic},
          FontFace       = {mb}{n}{*-Medium},
          FontFace       = {mb}{sc}{*-Medium},
          FontFace       = {mb}{sl}{*-Medium},
          FontFace       = {mb}{it}{*-MediumItalic},
          FontFace       = {b}{n}{*-Bold},
          FontFace       = {b}{sc}{*-Bold},
          FontFace       = {b}{sl}{*-Bold},
          FontFace       = {b}{it}{*-BoldItalic},
          FontFace       = {k}{n}{*-Black},
          FontFace       = {k}{sc}{*-Black},
          FontFace       = {k}{sl}{*-Black},
          FontFace       = {k}{it}{*-BlackItalic} ]
        {Roboto}
  \DeclareTextFontCommand{\oldstylenums}{\robotoOsF}
  \DeclareTextFontCommand{\liningnums}{\robotoLF}

\else % type1
  \def\robotofamily{Roboto-\roboto@figurealign\roboto@figurestyle}
  \def\robotocondensedfamily{RobotoCondensed-\roboto@figurealign\roboto@figurestyle}
  \def\robotoslabfamily{RobotoSlab-LF}
  \newcommand*\roboto{\fontfamily{\robotofamily}\selectfont}
  \newcommand*\robotocondensed{\fontfamily{\robotocondensedfamily}\selectfont}
  \newcommand*\robotoslab{\fontfamily{\robotoslabfamily}\selectfont}
  \def\sfdefault{\robotofamily}
  \ifroboto@condensed\def\sfdefault{\robotocondensedfamily}\fi  
  \ifroboto@default\edef\familydefault{\sfdefault}\edef\seriesdefault{\mdseries@sf}\fi
  \ifroboto@slab\edef\rmdefault{\robotoslabfamily}\fi

  \DeclareTextFontCommand{\oldstylenums}{\fontfamily{Roboto-\roboto@figurealign OsF}\selectfont}
  \DeclareTextFontCommand{\liningnums}{\fontfamily{Roboto-\roboto@figurealign LF}\selectfont}

\fi

\ifroboto@otf
  % turn off defaults in case other fonts are selected:
  \defaultfontfeatures{}
\fi

\endinput