type-imp-noto.mkxl /size: 3763 b    last modification: 2025-02-21 11:03
1%D \module
2%D   [       file=type-imp-noto,
3%D        version=2024.06.14,
4%D          title=\CONTEXT\ Typescript Macros,
5%D       subtitle=Google Noto Fonts,
6%D         author={Hans Hagen & Mikael Sundqvist},
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9
10%D This font is in development and we will cook up a proper goodie file when the
11%D time is ready for it. We also might need a companion font to deal with the serifs
12%D because after all we lost sans as distinctive shape and now need serif to act as
13%D such.
14%D
15%D In the past one could download a noto zip but in the meantime one is supposed to
16%D get the fonts from github.
17%D
18%D \starttyping
19%D local files = dir.glob([[<path to>/repositories/notofonts.github.io/fonts/**/full/otf/*.otf]])
20%D
21%D for i=1,#files do file.copy(files[i],file.basename(files[i])) end
22%D
23%D os.execute("mtxrun --generate")
24%D os.execute("mtxrun --script font --reload")
25%D \stoptyping
26
27\usetypescriptfile[dejavu]
28
29\starttypescriptcollection[notosans]
30
31    \doifunknownfontfeature {noto-math-bold} {\definefontfeature[noto-math-bold][boldened]}
32
33    \starttypescript [\s!serif] [noto] [\s!name]
34        \definefontsynonym [\s!Serif]           [\s!file:NotoSerif-Regular]    [\s!features=\s!default]
35        \definefontsynonym [\s!SerifItalic]     [\s!file:NotoSerif-Italic]     [\s!features=\s!default]
36        \definefontsynonym [\s!SerifBold]       [\s!file:NotoSerif-Bold]       [\s!features=\s!default]
37        \definefontsynonym [\s!SerifBoldItalic] [\s!file:NotoSerif-BoldItalic] [\s!features=\s!default]
38    \stoptypescript
39
40    \starttypescript [\s!sans] [noto] [\s!name]
41        \setups[\s!font:\s!fallback:\s!sans]
42        \definefontsynonym [\s!Sans]          [\s!file:NotoSans-Regular]       [\s!features=\s!default]
43        \definefontsynonym [\s!SansItalic]    [\s!file:NotoSans-Italic]        [\s!features=\s!default]
44        \definefontsynonym [\s!SansBold]      [\s!file:NotoSans-SemiBold]      [\s!features=\s!default]
45        \definefontsynonym [\s!SansBoldItalic][\s!file:NotoSans-SemiBoldItalic][\s!features=\s!default]
46    \stoptypescript
47
48  % \starttypescript [\s!mono] [noto] [\s!name]
49  %     \setups[\s!font:\s!fallback:\s!mono]
50  %     \definefontsynonym [\s!Mono]          [\s!file:NotoMono-Regular]       [\s!features=\s!none]
51  %     \definefontsynonym [\s!MonoItalic]    [\s!file:NotoMono-Italic]        [\s!features=\s!none]
52  %     \definefontsynonym [\s!MonoBold]      [\s!file:NotoMono-SemiBold]      [\s!features=\s!none]
53  %     \definefontsynonym [\s!MonoBoldItalic][\s!file:NotoMono-SemiBoldItalic][\s!features=\s!none]
54  % \stoptypescript
55
56    \starttypescript [\s!math] [noto][\s!name]
57        \checkedmapfontsize[\typescripttwo][\s!script]      [.70]
58        \checkedmapfontsize[\typescripttwo][\s!scriptscript][.55]
59    \stoptypescript
60
61    \starttypescript [\s!math] [noto][\s!name]
62        \definefontsynonym [\s!MathRoman]    [\s!file:NotoSansMath-Regular.otf][\s!features={\s!math\mathsizesuffix,noto:mathextra,mathextra},\s!goodies=notosans-math]
63        \definefontsynonym [\s!MathRomanBold][\s!file:NotoSansMath-Regular.otf][\s!features={\s!math\mathsizesuffix,noto-math-bold,noto:mathextra,mathextra},\s!goodies=notosans-math]
64    \stoptypescript
65
66    \starttypescript [noto]
67        \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default]
68        \definetypeface [\typescriptone] [\s!ss] [\s!sans]  [\typescriptone] [\s!default]
69        \definetypeface [\typescriptone] [\s!mm] [\s!math]  [\typescriptone] [\s!default]
70        \definetypeface [\typescriptone] [\s!tt] [\s!mono]  [dejavu]         [\s!default] % todo rscale
71        \quittypescriptscanning
72    \stoptypescript
73
74\stoptypescriptcollection
75