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
|
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{plex-sans}
[2019/10/123 (Bob Tennent) Style file for IBMPlexSans fonts]
\RequirePackage{ifxetex,ifluatex,xkeyval,textcomp}
\newif\ifplexsans@otf
\ifxetex
\plexsans@otftrue
\else\ifluatex
\plexsans@otftrue
\else % [pdf]LaTeX
\plexsans@otffalse
\fi\fi
\newcommand*{\IBMPlexSans@scale}{1}
\DeclareOptionX{scale}{\renewcommand*{\IBMPlexSans@scale}{#1}}
\newif\ifplexsans@sfdefault \plexsans@sfdefaultfalse
\newif\ifplexsans@condensed \plexsans@condensedfalse
\newif\ifplexsans@thin \plexsans@thinfalse
\newif\ifplexsans@extralight \plexsans@extralightfalse
\newif\ifplexsans@light \plexsans@lightfalse
\newif\ifplexsans@textmd \plexsans@textmdfalse
\newif\ifplexsans@text \plexsans@textfalse
\newif\ifplexsans@mediumbold \plexsans@mediumboldfalse
\newif\ifplexsans@semibold \plexsans@semiboldfalse
\DeclareOptionX{type1}{\plexsans@otffalse}
\DeclareOptionX{sfdefault}{\plexsans@sfdefaulttrue}
\DeclareOptionX{condensed}{\plexsans@condensedtrue}
\DeclareOptionX{thin}{\plexsans@thintrue}
\DeclareOptionX{t}{\plexsans@thintrue}
\DeclareOptionX{extralight}{\plexsans@extralighttrue}
\DeclareOptionX{el}{\plexsans@extralighttrue}
\DeclareOptionX{light}{\plexsans@lighttrue}
\DeclareOptionX{l}{\plexsans@lighttrue}
\DeclareOptionX{textmd}{\plexsans@textmdtrue}
\DeclareOptionX{txmd}{\plexsans@textmdtrue}
\DeclareOptionX{text}{\plexsans@texttrue}
\DeclareOptionX{tx}{\plexsans@texttrue}
\DeclareOptionX{medium}{\plexsans@mediumboldtrue}
\DeclareOptionX{mb}{\plexsans@mediumboldtrue}
\DeclareOptionX{semibold}{\plexsans@semiboldtrue}
\DeclareOptionX{sb}{\plexsans@semiboldtrue}
\ProcessOptionsX\relax
\ifplexsans@otf
\RequirePackage{fontspec}
\else % type1
\RequirePackage{fontenc,fontaxes,mweights}
\fa@naming@exception{figures}{{superior}{proportional}}{Sup}
\fa@naming@exception{figures}{{superior}{tabular}}{Sup}
\def\sufigures{\@nomath\sufigures
\fontfigurestyle{superior}\selectfont}
\DeclareTextFontCommand{\textsu}{\sufigures}
\let\textsuperior\textsu
\fi
\ifplexsans@otf
\def\plexsans@medstyle{Regular}
\ifplexsans@thin\def\plexsans@medstyle{Thin}
\else\ifplexsans@extralight\def\plexsans@medstyle{ExtraLight}
\else\ifplexsans@light\def\plexsans@medstyle{Light}
\else\ifplexsans@textmd\def\plexsans@medstyle{Text}\fi\fi\fi\fi
\def\plexsans@boldstyle{Bold}
\ifplexsans@text\def\plexsans@boldstyle{Text}
\else\ifplexsans@mediumbold\def\plexsans@boldstyle{Medium}
\else\ifplexsans@semibold\def\plexsans@boldstyle{SemiBold}\fi\fi\fi
\else % type1
\ifplexsans@condensed
\def\mdseries@sf{c}
\ifplexsans@thin\def\mdseries@sf{tc}
\else\ifplexsans@extralight\def\mdseries@sf{elc}
\else\ifplexsans@light\def\mdseries@sf{lc}
\else\ifplexsans@textmd\def\mdseries@sf{textcondensed}\fi\fi\fi\fi
\def\bfseries@sf{bc}
\ifplexsans@text\def\bfseries@sf{textcondensed}
\else\ifplexsans@mediumbold\def\bfseries@sf{mc}
\else\ifplexsans@semibold\def\bfseries@sf{sbc}\fi\fi\fi
\else
\def\mdseries@sf{m}
\ifplexsans@thin\def\mdseries@sf{t}
\else\ifplexsans@extralight\def\mdseries@sf{el}
\else\ifplexsans@light\def\mdseries@sf{l}
\else\ifplexsans@textmd\def\mdseries@sf{text}\fi\fi\fi\fi
\def\bfseries@sf{b}
\ifplexsans@text\def\bfseries@sf{text}
\else\ifplexsans@mediumbold\def\bfseries@sf{medium}
\else\ifplexsans@semibold\def\bfseries@sf{sb}\fi\fi\fi
\fi
\fi
\ifplexsans@otf
\def\plexsans@regular{Regular}
\ifxetex\XeTeXtracingfonts=1\fi
\defaultfontfeatures{
Ligatures = TeX ,
Scale = \IBMPlexSans@scale ,
Extension = .otf }
\ifplexsans@condensed
\setsansfont
[ UprightFont = *-\plexsans@medstyle ,
ItalicFont = *-\ifx\plexsans@medstyle\plexsans@regular
Italic
\else\plexsans@medstyle Italic\fi ,
BoldFont = *-\plexsans@boldstyle ,
BoldItalicFont = *-\plexsans@boldstyle Italic ]
{IBMPlexSansCondensed}
\else
\setsansfont
[ UprightFont = *-\plexsans@medstyle ,
ItalicFont = *-\ifx\plexsans@medstyle\plexsans@regular
Italic
\else\plexsans@medstyle Italic\fi ,
BoldFont = *-\plexsans@boldstyle ,
BoldItalicFont = *-\plexsans@boldstyle Italic ]
{IBMPlexSans}
\fi
\let\plexsansfamily\sfdefault
\ifplexsans@sfdefault\renewcommand*\familydefault{\plexsansfamily}\fi
\newfontfamily\plexsans
[ UprightFont = *-\plexsans@medstyle ,
ItalicFont = *-\ifx\plexsans@medstyle\plexsans@regular
Italic
\else\plexsans@medstyle Italic\fi ,
BoldFont = *-\plexsans@boldstyle ,
BoldItalicFont = *-\plexsans@boldstyle Italic ]
{IBMPlexSans}
\newfontfamily\plexsanscondensed
[ UprightFont = *-\plexsans@medstyle ,
ItalicFont = *-\ifx\plexsans@medstyle\plexsans@regular
Italic
\else\plexsans@medstyle Italic\fi ,
BoldFont = *-\plexsans@boldstyle ,
BoldItalicFont = *-\plexsans@boldstyle Italic ]
{IBMPlexSansCondensed}
\else % type1
\def\plexsansfamily{IBMPlexSans-TLF}
\newcommand*\plexsans{%
\def\mdseries@sf{m}
\ifplexsans@thin\def\mdseries@sf{ul}
\else\ifplexsans@extralight\def\mdseries@sf{el}
\else\ifplexsans@light\def\mdseries@sf{l}
\else\ifplexsans@textmd\def\mdseries@sf{text}\fi\fi\fi\fi
\def\bfseries@sf{bold}
\ifplexsans@text\def\bfseries@sf{text}
\else\ifplexsans@mediumbold\def\bfseries@sf{medium}
\else\ifplexsans@semibold\def\bfseries@sf{sb}\fi\fi\fi
\sffamily
}
\newcommand*\plexsanscondensed{%
\def\mdseries@sf{c}
\ifplexsans@thin\def\mdseries@sf{ulc}
\else\ifplexsans@extralight\def\mdseries@sf{elc}
\else\ifplexsans@light\def\mdseries@sf{lc}
\else\ifplexsans@textmd\def\mdseries@sf{text}\fi\fi\fi\fi
\def\bfseries@sf{bc}
\ifplexsans@text\def\bfseries@sf{textcondensed}
\else\ifplexsans@mediumbold\def\bfseries@sf{mediumcondensed}
\else\ifplexsans@semibold\def\bfseries@sf{sbc}\fi\fi\fi
\sffamily
}
\renewcommand*\sfdefault{\plexsansfamily}
\ifplexsans@sfdefault\edef\familydefault{\sfdefault}\edef\seriesdefault{\mdseries@sf}\fi
\fi
\newcommand*\plexsanslgr{\fontencoding{LGR}\fontfamily{IBMPlexSans-TLF}\selectfont} % even for otf
\ifplexsans@otf
% turn off defaults in case other fonts are selected:
\defaultfontfeatures{}
\fi
\endinput
|