summaryrefslogtreecommitdiff
path: root/fonts/noto/latex/noto-serif.sty
blob: cc4116be8faeb819eb838e0b1f30310ab83fd770 (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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{noto-serif}
    [2021/09/04 (Bob Tennent)  Supports NotoSerif fonts for all LaTeX engines.]

\RequirePackage{ifxetex,ifluatex,xkeyval,textcomp}

\newif\ifnotoserif@ttf 
\ifxetex
  \notoserif@ttftrue
\else\ifluatex
  \notoserif@ttftrue
\else  % [pdf]LaTeX
  \notoserif@ttffalse
\fi\fi

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

\DeclareOptionX{type1}{\notoserif@ttffalse}

\newif\ifnotoserif@oldstyle \notoserif@oldstylefalse
\newif\ifnotoserif@proportional \notoserif@proportionalfalse

\DeclareOptionX{lining}{\notoserif@oldstylefalse}
\DeclareOptionX{lf}{\notoserif@oldstylefalse}
\DeclareOptionX{tabular}{\notoserif@proportionalfalse}
\DeclareOptionX{tf}{\notoserif@proportionalfalse}
\DeclareOptionX{proportional}{\notoserif@proportionaltrue}
\DeclareOptionX{pf}{\notoserif@proportionaltrue}
\DeclareOptionX{oldstyle}{\notoserif@oldstyletrue}
\DeclareOptionX{osf}{\notoserif@oldstyletrue}

\newif\ifnotoserif@thin \notoserif@thinfalse
\newif\ifnotoserif@extralight \notoserif@extralightfalse
\newif\ifnotoserif@light \notoserif@lightfalse
\newif\ifnotoserif@medium \notoserif@mediumfalse
\newif\ifnotoserif@semibold \notoserif@semiboldfalse
\newif\ifnotoserif@extrabold \notoserif@extraboldfalse
\newif\ifnotoserif@black \notoserif@blackfalse

\newif\ifnotoserif@condensed \notoserif@condensedfalse
\newif\ifnotoserif@semicondensed \notoserif@semicondensedfalse
\newif\ifnotoserif@extracondensed \notoserif@extracondensedfalse

\DeclareOptionX{thin}{\notoserif@thintrue}
\DeclareOptionX{extralight}{\notoserif@extralighttrue}
\DeclareOptionX{light}{\notoserif@lighttrue}
\DeclareOptionX{regular}{\notoserif@lightfalse\notoserif@thinfalse\notoserif@extralightfalse\notoserif@mediumfalse}
\DeclareOptionX{medium}{\notoserif@mediumtrue}
\DeclareOptionX{semibold}{\notoserif@semiboldtrue}
\DeclareOptionX{extrabold}{\notoserif@extraboldtrue}
\DeclareOptionX{black}{\notoserif@blacktrue}
\DeclareOptionX{bold}{\notoserif@blackfalse\notoserif@semiboldfalse\notoserif@extraboldfalse}
\DeclareOptionX{condensed}{\notoserif@condensedtrue}
\DeclareOptionX{semicondensed}{\notoserif@semicondensedtrue}
\DeclareOptionX{extracondensed}{\notoserif@extracondensedtrue}

\ProcessOptionsX\relax

\ifnotoserif@ttf
  \def\notoserif@boldstyle{Bold}
  \ifnotoserif@semibold\def\notoserif@boldstyle{SemiBold}\fi
  \ifnotoserif@extrabold\def\notoserif@boldstyle{ExtraBold}\fi
  \ifnotoserif@black\def\notoserif@boldstyle{Black}\fi
  \def\notoserif@regstyle{Regular}
  \ifnotoserif@thin\def\notoserif@regstyle{Thin}\fi
  \ifnotoserif@extralight\def\notoserif@regstyle{ExtraLight}\fi
  \ifnotoserif@light\def\notoserif@regstyle{Light}\fi
  \ifnotoserif@medium\def\notoserif@regstyle{Medium}\fi

\else % type1

  \def\seriesdefault{\mdseries@rm}

  \def\bfseries@rm{b}
  \ifnotoserif@semibold\def\bfseries@rm{sb}\fi
  \ifnotoserif@extrabold\def\bfseries@rm{eb}\fi
  \ifnotoserif@black\def\bfseries@rm{ub}\fi
  \def\mdseries@rm{m}
  \ifnotoserif@thin\def\mdseries@rm{ul}\fi
  \ifnotoserif@extralight\def\mdseries@rm{el}\fi
  \ifnotoserif@light\def\mdseries@rm{l}\fi
  \ifnotoserif@medium\def\mdseries@rm{medium}\fi

  \ifnotoserif@condensed
    \def\bfseries@rm{bc}\def\mdseries@rm{c}
    \ifnotoserif@semibold\def\bfseries@rm{sbc}\fi
    \ifnotoserif@extrabold\def\bfseries@rm{ebc}\fi
    \ifnotoserif@black\def\bfseries@rm{ubc}\fi
    \ifnotoserif@thin\def\mdseries@rm{ulc}\fi
    \ifnotoserif@extralight\def\mdseries@rm{elc}\fi
    \ifnotoserif@light\def\mdseries@rm{lc}\fi
    \ifnotoserif@medium\def\mdseries@rm{mediumcondensed}\fi
  \else\ifnotoserif@semicondensed
    \def\bfseries@rm{bsc}\def\mdseries@rm{sc}
    \ifnotoserif@semibold\def\bfseries@rm{sbsc}\fi
    \ifnotoserif@extrabold\def\bfseries@rm{ebsc}\fi
    \ifnotoserif@black\def\bfseries@rm{ubsc}\fi
    \ifnotoserif@thin\def\mdseries@rm{ulsc}\fi
    \ifnotoserif@extralight\def\mdseries@rm{elsc}\fi
    \ifnotoserif@light\def\mdseries@rm{lsc}\fi
    \ifnotoserif@medium\def\mdseries@rm{mediumsemicondensed}\fi
  \else\ifnotoserif@extracondensed
    \def\bfseries@rm{bec}\def\mdseries@rm{ec}
    \ifnotoserif@semibold\def\bfseries@rm{sbec}\fi
    \ifnotoserif@extrabold\def\bfseries@rm{ebec}\fi
    \ifnotoserif@black\def\bfseries@rm{ubec}\fi
    \ifnotoserif@thin\def\mdseries@rm{ulec}\fi
    \ifnotoserif@extralight\def\mdseries@rm{elec}\fi
    \ifnotoserif@light\def\mdseries@rm{lec}\fi
    \ifnotoserif@medium\def\mdseries@rm{mediumsemicondensed}\fi
  \fi\fi\fi

\fi

\ifnotoserif@ttf
  
  \def\notoserif@figurestyle{Lining}
  \ifnotoserif@oldstyle\def\notoserif@figurestyle{OldStyle}\fi
  \def\notoserif@figurealign{Monospaced}
  \ifnotoserif@proportional\def\notoserif@figurealign{Proportional}\fi

\else % type1

  \def\notoserif@figurestyle{LF}
  \ifnotoserif@oldstyle\def\notoserif@figurestyle{OsF}\fi
  \def\notoserif@figurealign{T}
  \ifnotoserif@proportional\def\notoserif@figurealign{}\fi

\fi

\ifnotoserif@ttf
  \RequirePackage{fontspec}
\else
  \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}
\fi

\ifnotoserif@ttf
  \def\notoserif@regular{Regular}
  \ifxetex\XeTeXtracingfonts=1\fi
  \defaultfontfeatures{
        Ligatures = TeX ,
        Extension = .ttf }
    \ifnotoserif@condensed
      \setmainfont
        [ Scale     = \NotoSerif@scale ,
          Numbers   = {\notoserif@figurealign, \notoserif@figurestyle} ,
          SmallCapsFeatures={Letters=SmallCaps} ,
          UprightFont    = *\ifx\notoserif@regstyle\notoserif@regular\else\notoserif@regstyle\fi ,
          ItalicFont     = *\ifx\notoserif@regstyle\notoserif@regular Italic\else\notoserif@regstyle Italic\fi ,
          BoldFont       = *\notoserif@boldstyle , 
          BoldItalicFont = *\notoserif@boldstyle Italic ,
        ]
        {NotoSerif-Condensed}
    \else\ifnotoserif@semicondensed
      \setmainfont
        [ Numbers   = {\notoserif@figurealign, \notoserif@figurestyle} ,
          SmallCapsFeatures={Letters=SmallCaps} ,
          UprightFont    = *\ifx\notoserif@regstyle\notoserif@regular\else\notoserif@regstyle\fi ,
          ItalicFont     = *\ifx\notoserif@regstyle\notoserif@regular Italic\else\notoserif@regstyle Italic\fi ,
          BoldFont       = *\notoserif@boldstyle , 
          BoldItalicFont = *\notoserif@boldstyle Italic ,
        ]
        {NotoSerif-SemiCondensed}
    \else\ifnotoserif@extracondensed
      \setmainfont
        [ Numbers   = {\notoserif@figurealign, \notoserif@figurestyle} ,
          SmallCapsFeatures={Letters=SmallCaps} ,
          UprightFont    = *\ifx\notoserif@regstyle\notoserif@regular\else\notoserif@regstyle\fi ,
          ItalicFont     = *\ifx\notoserif@regstyle\notoserif@regular Italic\else\notoserif@regstyle Italic\fi ,
          BoldFont       = *\notoserif@boldstyle , 
          BoldItalicFont = *\notoserif@boldstyle Italic ,
        ]
        {NotoSerif-ExtraCondensed}
    \else
      \setmainfont
          [ Numbers   = {\notoserif@figurealign, \notoserif@figurestyle} ,
            SmallCapsFeatures={Letters=SmallCaps} ,
            UprightFont    = *-\notoserif@regstyle ,
            ItalicFont     = *-\ifx\notoserif@regstyle\notoserif@regular Italic\else\notoserif@regstyle Italic\fi ,
            BoldFont       = *-\notoserif@boldstyle , 
            BoldItalicFont = *-\notoserif@boldstyle Italic ,
          ]
          {NotoSerif}
    \fi\fi\fi

  \def\notoserif@Lining{Lining}
  \newfontfamily\notoserif
          [ Numbers   = {\notoserif@figurealign, \notoserif@figurestyle} ,
            SmallCapsFeatures={Letters=SmallCaps} ,
            UprightFont    = *-\notoserif@regstyle ,
            ItalicFont     = *-\ifx\notoserif@regstyle\notoserif@regular Italic\else\notoserif@regstyle Italic\fi ,
            BoldFont       = *-\notoserif@boldstyle , 
            BoldItalicFont = *-\notoserif@boldstyle Italic ,
          ]
          {NotoSerif}
  \newfontfamily\notoserifcondensed
        [ Numbers   = {\notoserif@figurealign, \notoserif@figurestyle} ,
          SmallCapsFeatures={Letters=SmallCaps} ,
          UprightFont    = *\ifx\notoserif@regstyle\notoserif@regular\else\notoserif@regstyle\fi ,
          ItalicFont     = *\ifx\notoserif@regstyle\notoserif@regular Italic\else\notoserif@regstyle Italic\fi ,
          BoldFont       = *\notoserif@boldstyle , 
          BoldItalicFont = *\notoserif@boldstyle Italic ,
        ]
        {NotoSerif-Condensed}
  \newfontfamily\notoserifsemicondensed
        [ Numbers   = {\notoserif@figurealign, \notoserif@figurestyle} ,
          SmallCapsFeatures={Letters=SmallCaps} ,
          UprightFont    = *\ifx\notoserif@regstyle\notoserif@regular\else\notoserif@regstyle\fi ,
          ItalicFont     = *\ifx\notoserif@regstyle\notoserif@regular Italic\else\notoserif@regstyle Italic\fi ,
          BoldFont       = *\notoserif@boldstyle , 
          BoldItalicFont = *\notoserif@boldstyle Italic ,
        ]
        {NotoSerif-SemiCondensed}
  \newfontfamily\notoserifextracondensed
        [ Numbers   = {\notoserif@figurealign, \notoserif@figurestyle} ,
          SmallCapsFeatures={Letters=SmallCaps} ,
          UprightFont    = *\ifx\notoserif@regstyle\notoserif@regular\else\notoserif@regstyle\fi ,
          ItalicFont     = *\ifx\notoserif@regstyle\notoserif@regular Italic\else\notoserif@regstyle Italic\fi ,
          BoldFont       = *\notoserif@boldstyle , 
          BoldItalicFont = *\notoserif@boldstyle Italic  ,
        ]
        {NotoSerif-ExtraCondensed}

  \providecommand\sufigures{\addfontfeatures{VerticalPosition=Superior}}

\else % type1
  \def\notoseriffamily{NotoSerif-\notoserif@figurealign\notoserif@figurestyle}
  \newcommand*\notoserif{\fontfamily{\notoseriffamily}\selectfont}
  \newcommand*\notoserifcondensed{\fontfamily{\notoseriffamily}\fontseries{c}\selectfont}
  \newcommand*\notoserifsemicondensed{\fontfamily{\notoseriffamily}\fontseries{sc}\selectfont}
  \newcommand*\notoserifextracondensed{\fontfamily{\notoseriffamily}\fontseries{ec}\selectfont}

  \def\rmdefault{\notoseriffamily} 
\fi

\DeclareTextFontCommand{\textsu}{\sufigures}

% LGR

\def\notoserif@figurestyle{LF}
\ifnotoserif@oldstyle\def\notoserif@figurestyle{OsF}\fi
\def\notoserif@figurealign{T}
\ifnotoserif@proportional\def\notoserif@figurealign{}\fi
\newcommand*\notoseriflgr{\fontencoding{LGR}\fontfamily{NotoSerif-\notoserif@figurealign\notoserif@figurestyle}\selectfont}


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

\endinput