summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/roboto/roboto-mono.sty
blob: 5e90a8f021ce5780d2400b4e689a786c3d299ee2 (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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{roboto-mono}
    [2019/02/28 (Bob Tennent)  Supports RobotoMono fonts for all LaTeX engines.]

\RequirePackage{ifxetex,ifluatex,xkeyval,textcomp}

\newif\ifrobotomono@otf 
\ifxetex
  \robotomono@otftrue
\else\ifluatex
  \robotomono@otftrue
\else  % [pdf]LaTeX
  \robotomono@otffalse
\fi\fi


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

\newif\ifrobotomono@light \robotomono@lightfalse
\newif\ifrobotomono@thin \robotomono@thinfalse
\newif\ifrobotomono@medium \robotomono@mediumfalse
\newif\ifrobotomono@black \robotomono@blackfalse

\DeclareOptionX{type1}{\robotomono@otffalse}
\DeclareOptionX{medium}{\robotomono@mediumtrue\robotomono@blackfalse}
\DeclareOptionX{bold}{\robotomono@blackfalse\robotomono@mediumfalse}
\DeclareOptionX{black}{\robotomono@blacktrue\robotomono@mediumfalse}
\DeclareOptionX{thin}{\robotomono@thintrue\robotomono@lightfalse}
\DeclareOptionX{light}{\robotomono@lighttrue\robotomono@thinfalse}
\DeclareOptionX{regular}{\robotomono@lightfalse\robotomono@thinfalse}

\ExecuteOptionsX{bold,regular}
\ProcessOptionsX\relax

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

\else % type1

  \def\bfseries@tt{b}
  \ifrobotomono@medium\def\bfseries@tt{mb}\fi
  \ifrobotomono@black\def\bfseries@tt{k}\fi
  \def\mdseries@tt{m}
  \ifrobotomono@thin\def\mdseries@tt{t}\fi
  \ifrobotomono@light\def\mdseries@tt{l}\fi

\fi

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

\ifrobotomono@otf
  \def\robotomono@regular{Regular}
  \ifxetex\XeTeXtracingfonts=1\fi
  \defaultfontfeatures{
        Ligatures = TeX ,
        Scale     = \RobotoMono@scale ,
        Extension = .ttf }
    \setmonofont
        [ 
          UprightFont    = *-\robotomono@regstyle ,
          ItalicFont     = *-\ifx\robotomono@regstyle\robotomono@regular Italic\else\robotomono@regstyle Italic\fi ,
          BoldFont       = *-\robotomono@boldstyle ,
          BoldItalicFont = *-\robotomono@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} ]
        {RobotoMono}
  % grab current family in case of subsequent change:
  \let\robotomonofamily\ttdefault  
  \newfontfamily\robotomono
        [ 
          UprightFont    = *-\robotomono@regstyle ,
          ItalicFont     = *-\ifx\robotomono@regstyle\robotomono@regular Italic\else\robotomono@regstyle Italic\fi ,
          BoldFont       = *-\robotomono@boldstyle ,
          BoldItalicFont = *-\robotomono@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} ]
        {RobotoMono}
\else % type1
  \def\robotomonofamily{RobotoMono-TLF}
  \newcommand*\robotomono{\fontfamily{\robotomonofamily}\selectfont}
  \def\ttdefault{\robotomonofamily}
\fi

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

\endinput