summaryrefslogtreecommitdiff
path: root/tex/context/fonts/mkiv/type-imp-plex.mkiv
blob: 99b099474a27e480030dd6908e93310b5675dfc6 (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
%D \module
%D   [       file=type-imp-plex,
%D        version=2018.09.11,
%D          title=\CONTEXT\ Typescript Macros,
%D       subtitle=Plex fonts,
%D         author={Hans Hagen & Taco Hoekwater},
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

% Taco will make a special (more verbose) one for the ConTeXt journal! That setup will also have
% adapted interline spacing matching the larger ascenders.

% [IBMPlexMono|IBMPlexSans|IBMPlexSerif|IBMPlexSansCondensed]-[Thin|Light|Text||Medium|SemiBold|Bold|Extra].otf
% [IBMPlexMono|IBMPlexSans|IBMPlexSerif|IBMPlexSansCondensed]-[Thin|Light|Text||Medium|SemiBold|Bold|Extra]Italic.otf

% [IBMPlexSans][Hebrew]-[Thin|Light|Text||Medium|SemiBold|Bold|].otf

\loadtypescriptfile[bookman]

\starttypescriptcollection[plex]

    \definetypescriptprefix [n:plexserif]       [IBMPlexSerif]
    \definetypescriptprefix [n:plexsans]        [IBMPlexSans]
    \definetypescriptprefix [n:plexmono]        [IBMPlexMono]

    \definetypescriptprefix [n:plexserifnarrow] [IBMPlexSerif]
    \definetypescriptprefix [n:plexsansnarrow]  [IBMPlexSansCondensed]
    \definetypescriptprefix [n:plexmonnarrow]   [IBMPlexMono]

    \definetypescriptprefix [f:plexserif]       [\s!default]
    \definetypescriptprefix [f:plexsans]        [\s!default]
    \definetypescriptprefix [f:plexmono]        [\s!none]

    \definetypescriptprefix [f:plexserifnarrow] [\s!default]
    \definetypescriptprefix [f:plexsansnarrow]  [\s!default]
    \definetypescriptprefix [f:plexmononarrow]  [\s!none]

    % [THIN|light|TEXT||medium|semibold|bold|extra]

    \starttypescript [\s!sans,\s!serif,\s!mono] [plex-thin,plex-hairline] [\s!name]
        \setups[\s!font:\s!fallback:\typescriptone]
        \definefontsynonym [\typescriptprefix{\typescriptone}]              [\s!file:\typescriptprefix{n:plex\typescriptone}-thin]       [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic]     [\s!file:\typescriptprefix{n:plex\typescriptone}-thinitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold]       [\s!file:\typescriptprefix{n:plex\typescriptone}-text]       [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-text]       [\s!features=\typescriptprefix{f:plex\typescriptone}]
    \stoptypescript

    % [thin|LIGHT|text||medium|semibold|bold|extra]

    \starttypescript [\s!sans,\s!serif,\s!mono] [plex-light] [\s!name]
        \setups[\s!font:\s!fallback:\typescriptone]
        \definefontsynonym [\typescriptprefix{\typescriptone}]              [\s!file:\typescriptprefix{n:plex\typescriptone}-light]       [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic]     [\s!file:\typescriptprefix{n:plex\typescriptone}-lightitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold]       [\s!file:\typescriptprefix{n:plex\typescriptone}-regular]     [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-italic]      [\s!features=\typescriptprefix{f:plex\typescriptone}]
    \stoptypescript

    % [thin|light|TEXT||MEDIUM|semibold|bold|extra]

    \starttypescript [\s!sans,\s!serif,\s!mono] [plex-text] [\s!name]
        \setups[\s!font:\s!fallback:\typescriptone]
        \definefontsynonym [\typescriptprefix{\typescriptone}]              [\s!file:\typescriptprefix{n:plex\typescriptone}-text]         [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic]     [\s!file:\typescriptprefix{n:plex\typescriptone}-textitalic]   [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold]       [\s!file:\typescriptprefix{n:plex\typescriptone}-medium]       [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-mediumitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
    \stoptypescript

    % [thin|light|text||medium|SEMIBOLD|bold|extra]

    \starttypescript [\s!sans,\s!serif,\s!mono] [plex] [\s!name]
        \setups[\s!font:\s!fallback:\typescriptone]
        \definefontsynonym [\typescriptprefix{\typescriptone}]              [\s!file:\typescriptprefix{n:plex\typescriptone}-regular]        [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic]     [\s!file:\typescriptprefix{n:plex\typescriptone}-italic]         [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold]       [\s!file:\typescriptprefix{n:plex\typescriptone}-semibold]       [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-semibolditalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
    \stoptypescript

    % [thin|light|text||MEDIUM|semibold|BOLD|extra]

    \starttypescript [\s!sans,\s!serif,\s!mono] [plex-medium] [\s!name]
        \setups[\s!font:\s!fallback:\typescriptone]
        \definefontsynonym [\typescriptprefix{\typescriptone}]              [\s!file:\typescriptprefix{n:plex\typescriptone}-medium]       [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic]     [\s!file:\typescriptprefix{n:plex\typescriptone}-mediumitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold]       [\s!file:\typescriptprefix{n:plex\typescriptone}-bold]         [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-bolditalic]   [\s!features=\typescriptprefix{f:plex\typescriptone}]
    \stoptypescript

    % [thin|light|text||medium|SEMIBOLD|bold|EXTRA]

    \starttypescript [\s!sans,\s!serif,\s!mono] [plex-semibold,plex-dark,plex-black] [\s!name]
        \setups[\s!font:\s!fallback:\typescriptone]
        \definefontsynonym [\typescriptprefix{\typescriptone}]              [\s!file:\typescriptprefix{n:plex\typescriptone}-semibold]       [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic]     [\s!file:\typescriptprefix{n:plex\typescriptone}-semibolditalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold]       [\s!file:\typescriptprefix{n:plex\typescriptone}-extra]          [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-extraitalic]    [\s!features=\typescriptprefix{f:plex\typescriptone}]
    \stoptypescript

    \starttypescript[plex,plex-thin,plex-hairline,plex-light,plex-text,plex-medium,plex-semibold,plex-dark,plex-black]
        \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default]
        \definetypeface [\typescriptone] [\s!ss] [\s!sans]  [\typescriptone] [\s!default]
        \definetypeface [\typescriptone] [\s!tt] [\s!mono]  [\typescriptone] [\s!default]
        \definetypeface [\typescriptone] [\s!mm] [\s!math]  [bookman]        [\s!default] [\s!rscale=1.03]
    \stoptypescript

    % Here's Taco's variant as used in the ConTeXt Group Journal.

    \starttypescript [\s!sans,\s!serif,\s!mono] [ibmplex-thin,ibmplexnarrow-thin] [\s!name]
        \setups[\s!font:\s!fallback:\typescriptone]
        \definefontsynonym [\typescriptprefix{\typescriptone}]              [\s!file:\typescriptprefix{n:plex\typescriptone}-thin]       [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic]     [\s!file:\typescriptprefix{n:plex\typescriptone}-thinitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold]       [\s!file:\typescriptprefix{n:plex\typescriptone}-text]       [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-textitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
    \stoptypescript

    \starttypescript [\s!sans,\s!serif,\s!mono] [ibmplex-extralight,ibmplexnarrow-extralight] [\s!name]
        \setups[\s!font:\s!fallback:\typescriptone]
        \definefontsynonym [\typescriptprefix{\typescriptone}]              [\s!file:\typescriptprefix{n:plex\typescriptone}-extralight]       [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic]     [\s!file:\typescriptprefix{n:plex\typescriptone}-extralightitalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold]       [\s!file:\typescriptprefix{n:plex\typescriptone}-medium]           [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-mediumitalic]     [\s!features=\typescriptprefix{f:plex\typescriptone}]
    \stoptypescript

    \starttypescript [\s!sans,\s!serif,\s!mono] [ibmplex-light,ibmplexnarrow-light] [\s!name]
        \setups[\s!font:\s!fallback:\typescriptone]
        \definefontsynonym [\typescriptprefix{\typescriptone}]              [\s!file:\typescriptprefix{n:plex\typescriptone}-light]          [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic]     [\s!file:\typescriptprefix{n:plex\typescriptone}-lightitalic]    [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold]       [\s!file:\typescriptprefix{n:plex\typescriptone}-semibold]       [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-semibolditalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
    \stoptypescript

    \starttypescript [\s!sans,\s!serif,\s!mono] [ibmplex,ibmplexnarrow-light] [\s!name]
        \setups[\s!font:\s!fallback:\typescriptone]
        \definefontsynonym [\typescriptprefix{\typescriptone}]              [\s!file:\typescriptprefix{n:plex\typescriptone}-regular]    [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!Italic]     [\s!file:\typescriptprefix{n:plex\typescriptone}-italic]     [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold]       [\s!file:\typescriptprefix{n:plex\typescriptone}-bold]       [\s!features=\typescriptprefix{f:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!BoldItalic] [\s!file:\typescriptprefix{n:plex\typescriptone}-bolditalic] [\s!features=\typescriptprefix{f:plex\typescriptone}]
    \stoptypescript

    % For now, as some day plex will have cjk, hebrew, devanagari and arabic. The abstraction is not needed but
    % this way we can add more id needed without much code.

    \definetypescriptprefix [tf:plexsans] [SansHebrewFallback]
    \definetypescriptprefix [bf:plexsans] [SansHebrewFallbackBold]

    \definetypescriptprefix [n:plexsans-hebrew] [IBMPlexSansHebrew]

    \definefontfallback [SansHebrewFallback]     [SansHebrew]     [0x0590-0x05ff] [check=yes,force=no]
    \definefontfallback [SansHebrewFallbackBold] [SansHebrewBold] [0x0590-0x05ff] [check=yes,force=no]

    \starttypescript [\s!sans] [ibmplex-thin] [\s!name]
        \definefontsynonym [\typescriptprefix{\typescriptone}]              [\s!file:\typescriptprefix{n:plex\typescriptone}-extralight]
                                                                            [\s!features=\typescriptprefix{f:plex\typescriptone},
                                                                             \s!fallbacks=\typescriptprefix{tf:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold]       [\s!file:\typescriptprefix{n:plex\typescriptone}-medium]
                                                                            [\s!features=\typescriptprefix{f:plex\typescriptone},
                                                                             \s!fallbacks=\typescriptprefix{bf:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew]        [\s!file:\typescriptprefix{n:plex\typescriptone-hebrew}-extralight]
                                                                            [\s!features=hebrew]
        \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone-hebrew}-medium]
                                                                            [\s!features=hebrew]
    \stoptypescript

    \starttypescript [\s!sans] [ibmplex-extralight] [\s!name]
        \definefontsynonym [\typescriptprefix{\typescriptone}]              [\s!file:\typescriptprefix{n:plex\typescriptone}-thin]
                                                                            [\s!features=\typescriptprefix{f:plex\typescriptone},
                                                                             \s!fallbacks=\typescriptprefix{tf:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold]       [\s!file:\typescriptprefix{n:plex\typescriptone}-text]
                                                                            [\s!features=\typescriptprefix{f:plex\typescriptone},
                                                                             \s!fallbacks=\typescriptprefix{bf:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew]        [\s!file:\typescriptprefix{n:plex\typescriptone-hebrew}-thin]
                                                                            [\s!features=hebrew]
        \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone-hebrew}-text]
                                                                            [\s!features=hebrew]
    \stoptypescript

    \starttypescript [\s!sans] [ibmplex-light] [\s!name]
        \definefontsynonym [\typescriptprefix{\typescriptone}]              [\s!file:\typescriptprefix{n:plex\typescriptone}-light]
                                                                            [\s!features=\typescriptprefix{f:plex\typescriptone},
                                                                             \s!fallbacks=\typescriptprefix{tf:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold]       [\s!file:\typescriptprefix{n:plex\typescriptone}-semibold]
                                                                            [\s!features=\typescriptprefix{f:plex\typescriptone},
                                                                             \s!fallbacks=\typescriptprefix{bf:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew]        [\s!file:\typescriptprefix{n:plex\typescriptone-hebrew}-light]
                                                                            [\s!features=hebrew]
        \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone-hebrew}-semibold]
                                                                            [\s!features=hebrew]
    \stoptypescript

    \starttypescript [\s!sans] [ibmplex] [\s!name]
        \definefontsynonym [\typescriptprefix{\typescriptone}]              [\s!file:\typescriptprefix{n:plex\typescriptone}-regular]
                                                                            [\s!features=\typescriptprefix{f:plex\typescriptone},
                                                                             \s!fallbacks=\typescriptprefix{tf:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}\s!Bold]       [\s!file:\typescriptprefix{n:plex\typescriptone}-bold]
                                                                            [\s!features=\typescriptprefix{f:plex\typescriptone},
                                                                             \s!fallbacks=\typescriptprefix{bf:plex\typescriptone}]
        \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew]        [\s!file:\typescriptprefix{n:plex\typescriptone-hebrew}-regular]
                                                                            [\s!features=hebrew]
        \definefontsynonym [\typescriptprefix{\typescriptone}Hebrew\s!Bold] [\s!file:\typescriptprefix{n:plex\typescriptone-hebrew}-bold]
                                                                            [\s!features=hebrew]
    \stoptypescript

    % The main definition, inspired by discussion at the 2018 ConTeXt meeting after a talk by Taco. Here
    % we default to sans serif. Taco: take your choice of math!

    \starttypescript[ibmplex,ibmplex-thin,ibmplex-extralight,ibmplex-light]
        \definetypeface [\typescriptone] [\s!ss] [\s!sans]  [\typescriptone] [\s!default]
        \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default]
        \definetypeface [\typescriptone] [\s!tt] [\s!mono]  [\typescriptone] [\s!default]
        \definetypeface [\typescriptone] [\s!mm] [\s!math]  [bookman]        [\s!default] [\s!rscale=1.03]
    \stoptypescript

    \starttypescript[ibmplexnarrow,ibmplexnarrow-thin,ibmplexnarrow-extralight,ibmplexnarrow-light]
        \definetypeface [\typescriptone] [\s!ss] [\s!sans]  [\typescriptone] [\s!default]
        \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default]
        \definetypeface [\typescriptone] [\s!tt] [\s!mono]  [\typescriptone] [\s!default]
        \definetypeface [\typescriptone] [\s!mm] [\s!math]  [bookman]        [\s!default] [\s!rscale=1.03]
    \stoptypescript

\stoptypescriptcollection