summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/inter/inter.sty
blob: 4660c308f95c9b76c7117696ba32e2290f251168 (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
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{inter}
    [2021/04/16 (Carl-Clemens Ebinger and autoinst)  Style file for Inter fonts.]

\RequirePackage{ifxetex,ifluatex,xkeyval,textcomp}

\newif\ifinter@otf 
\ifxetex
  \inter@otftrue
\else\ifluatex
  \inter@otftrue
\else  % [pdf]LaTeX
  \inter@otffalse
\fi\fi

\newif\ifinter@tabular \inter@tabularfalse

\newif\ifinter@medium  \inter@mediumfalse
\newif\ifinter@semibold  \inter@semiboldfalse
\newif\ifinter@extrabold  \inter@extraboldfalse
\newif\ifinter@heavy  \inter@heavyfalse
\newif\ifinter@light  \inter@lightfalse
\newif\ifinter@extralight  \inter@extralightfalse
\newif\ifinter@thin  \inter@thinfalse
\newif\ifinter@default \inter@defaultfalse

\newcommand*{\Inter@scale}{1}
\RequirePackage{xkeyval}
\DeclareOptionX{scaled}{\renewcommand*{\Inter@scale}{#1}}
\DeclareOptionX{scale}{\renewcommand*{\Inter@scale}{#1}}
\DeclareOptionX{type1}{\inter@otffalse}
\DeclareOptionX{lining}{\inter@liningtrue}
\DeclareOptionX{tabular}{\inter@tabulartrue}
\DeclareOptionX{t}{\inter@tabulartrue}

\DeclareOptionX{medium}{\inter@mediumtrue}
\DeclareOptionX{mb}{\inter@mediumtrue}
\DeclareOptionX{semibold}{\inter@semiboldtrue}
\DeclareOptionX{sb}{\inter@semiboldtrue}
\DeclareOptionX{light}{\inter@lighttrue}
\DeclareOptionX{l}{\inter@lighttrue}
\DeclareOptionX{extralight}{\inter@extralighttrue}
\DeclareOptionX{thin}{\inter@thintrue}
\DeclareOptionX{extrabold}{\inter@extraboldtrue}
\DeclareOptionX{heavy}{\inter@heavytrue}
\DeclareOptionX{default}{\inter@defaulttrue}
\DeclareOptionX{sfdefault}{\inter@defaulttrue}


\ProcessOptionsX

\ifinter@otf
  \ifinter@tabular
    \def\inter@otffigurealign{Monospaced} 
  \else
    \def\inter@otffigurealign{Proportional} 
  \fi

\else % type1

\ifinter@tabular
  \def\inter@figurealign{T}
\else
  \def\inter@figurealign{}
\fi

\fi

\ifinter@otf
  \def\inter@boldstyle{Bold}
  \ifinter@semibold\def\inter@boldstyle{SemiBold}\fi
  \ifinter@extrabold\def\inter@boldstyle{ExtraBold}\fi
  \ifinter@heavy\def\inter@boldstyle{Black}\fi

  \def\inter@regstyle{Regular}
  \ifinter@medium\def\inter@regstyle{Medium}\fi
  \ifinter@light\def\inter@regstyle{Light}\fi
  \ifinter@extralight\def\inter@regstyle{ExtraLight}\fi
  \ifinter@thin\def\inter@regstyle{Thin}\fi

\else % type1

  \def\bfseries@sf{b}
  \ifinter@semibold\def\bfseries@sf{sb}\fi
  \ifinter@extrabold\def\bfseries@sf{eb}\fi
  \ifinter@heavy\def\bfseries@sf{ub}\fi

  \def\mdseries@sf{m}
  \ifinter@medium\def\mdseries@sf{medium}\fi
  \ifinter@light\def\mdseries@sf{l}\fi
  \ifinter@extralight\def\mdseries@sf{el}\fi
  \ifinter@thin\def\mdseries@sf{ul}\fi
\fi


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

\ifinter@otf
  \def\inter@regular{Regular}
  \ifxetex\XeTeXtracingfonts=1\fi
  \defaultfontfeatures{
        Ligatures = TeX ,
        Scale     = \Inter@scale ,
        Extension = .otf }
  \setsansfont
      [ Numbers = {\inter@otffigurealign},
        UprightFont    = *-\inter@regstyle ,
        ItalicFont = *-\ifx\inter@regstyle\inter@regular\else\inter@regstyle\fi Italic,
        BoldFont    = *-\inter@boldstyle ,
        BoldItalicFont     = *-\inter@boldstyle Italic ,
      ]
      {Inter}
  % grab current family in case of subsequent change:
  \let\interfamily\sfdefault  
  \ifinter@default\renewcommand*\familydefault{\interfamily}\fi

  \providecommand\sufigures{\addfontfeatures{VerticalPosition=Superior}}
  \newfontfamily\intertabular
    [ Numbers = {Monospaced},
        UprightFont    = *-\inter@regstyle ,
        ItalicFont = *-\ifx\inter@regstyle\inter@regular\else\inter@regstyle\fi Italic,
        BoldFont    = *-\inter@boldstyle ,
        BoldItalicFont     = *-\inter@boldstyle Italic ,
    ]
    {Inter}
  \newfontfamily\interproportional
    [ Numbers = {Proportional},
        UprightFont    = *-\inter@regstyle ,
        ItalicFont = *-\ifx\inter@regstyle\inter@regular\else\inter@regstyle\fi Italic,
        BoldFont    = *-\inter@boldstyle ,
        BoldItalicFont     = *-\inter@boldstyle Italic ,
    ]
    {Inter}
  \newfontfamily\interthin
      [ Numbers = {\inter@otffigurealign},
        UprightFont    = *-Thin ,
        ItalicFont     = *-ThinItalic ,
        BoldFont    = *-\inter@boldstyle ,
        BoldItalicFont     = *-\inter@boldstyle Italic ,
      ]
      {Inter}
  \newfontfamily\interlight
      [ Numbers = {\inter@otffigurealign},
        UprightFont    = *-Light ,
        ItalicFont     = *-LightItalic ,
        BoldFont    = *-\inter@boldstyle ,
        BoldItalicFont     = *-\inter@boldstyle Italic ,
      ]
      {Inter}
  \newfontfamily\interextralight
      [ Numbers = {\inter@otffigurealign},
        UprightFont    = *-ExtraLight ,
        ItalicFont     = *-ExtraLightItalic ,
        BoldFont    = *-\inter@boldstyle ,
        BoldItalicFont     = *-\inter@boldstyle Italic ,
      ]
      {Inter}
  \newfontfamily\intermedium
      [ Numbers = {\inter@otffigurealign},
        UprightFont    = *-Medium ,
        ItalicFont     = *-MediumItalic ,
        BoldFont    = *-\inter@boldstyle ,
        BoldItalicFont     = *-\inter@boldstyle Italic ,
      ]
      {Inter}
  \newfontfamily\intersemibold
      [ Numbers = {\inter@otffigurealign},
        UprightFont    = *-SemiBold ,
        ItalicFont     = *-SemiBoldItalic ,
      ]
      {Inter}
  \newfontfamily\interextrabold
      [ Numbers = {\inter@otffigurealign},
        UprightFont    = *-ExtraBold ,
        ItalicFont     = *-ExtraBoldItalic ,
      ]
      {Inter}
  \newfontfamily\interheavy
      [ Numbers = {\inter@otffigurealign},
        UprightFont    = *-Black ,
        ItalicFont     = *-BlackItalic ,
      ]
      {Inter}

\else % type1


  \def\inter@family{Inter-\inter@figurealign LF}
  \renewcommand*\sfdefault{\inter@family}
  \ifinter@default\edef\familydefault{\sfdefault}\edef\seriesdefault{\mdseries@sf}\fi

  \fa@naming@exception{figures}{{superior}{proportional}}{Sup}
  \fa@naming@exception{figures}{{superior}{tabular}}{Sup}
  \def\sufigures{\@nomath\sufigures\fontfigurestyle{superior}\selectfont}

  \def\intertabular{\fontfamily{Inter-TLF}\selectfont}
  \def\interproportional{\fontfamily{Inter-LF}\selectfont}

  \def\interthin{\fontfamily{\inter@family}\fontseries{thin}\selectfont}
  \def\interlight{\fontfamily{\inter@family}\fontseries{l}\selectfont}
  \def\interextralight{\fontfamily{\inter@family}\fontseries{el}\selectfont}
  \def\intermedium{\fontfamily{\inter@family}\fontseries{medium}\selectfont}
  \def\intersemibold{\fontfamily{\inter@family}\fontseries{sb}\selectfont}
  \def\interextrabold{\fontfamily{\inter@family}\fontseries{eb}\selectfont}
  \def\interheavy{\fontfamily{\inter@family}\fontseries{ub}\selectfont}

\fi

\ifinter@otf
  \defaultfontfeatures{}
\fi

\endinput