type-imp-newcomputermodern.mkiv /size: 6846 b    last modification: 2023-12-21 09:44
1%D \module
2%D   [       file=type-imp-newcomputermodern,
3%D        version=2021.06.08,
4%D          title=\CONTEXT\ Typescript Macros,
5%D       subtitle=NewComputerModern,
6%D         author=Hans Hagen,
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14%D There is something fishy with the books fonts. The otf files are twice as large
15%D as the normal ones but the tma's we filter from it are pretty close (mostly
16%D boundingbox differences). The streams are also of similar size so there must be
17%D something extra in there.
18
19% \definefontfallback[Serif]    [file:notoserif-regular.ttf] [0x0000-0xFFFF] [check=yes,rscale=1.02]
20% \definefontfallback[SerifBold][file:notoserif-bold.ttf]    [0x0000-0xFFFF] [check=yes,rscale=1.02]
21
22\starttypescriptcollection[newcomputermodern]
23
24    \doifunknownfontfeature {newcomputermodern-math-bold} {\definefontfeature[newcomputermodern-math-bold][boldened]}
25
26    \starttypescript [\s!serif] [newcomputermodern] [\s!name]
27        \setups[\s!font:\s!fallback:\s!serif]
28        \definefontsynonym [\s!Serif]           [\s!file:newcm10-regular.otf]    [\s!features=\s!default,\s!fallbacks=\s!Serif,\s!goodies=newcomputermodern-text]
29        \definefontsynonym [\s!SerifBold]       [\s!file:newcm10-bold.otf]       [\s!features=\s!default,\s!fallbacks=\s!SerifBold,\s!goodies=newcomputermodern-text]
30        \definefontsynonym [\s!SerifItalic]     [\s!file:newcm10-italic.otf]     [\s!features=\s!default,\s!fallbacks=\s!SerifItalic,\s!goodies=newcomputermodern-text]
31        \definefontsynonym [\s!SerifBoldItalic] [\s!file:newcm10-bolditalic.otf] [\s!features=\s!default,\s!fallbacks=\s!SerifBoldItalic,\s!goodies=newcomputermodern-text]
32    \stoptypescript
33
34    \starttypescript [\s!sans] [newcomputermodern] [\s!name]
35        \setups[\s!font:\s!fallback:\s!sans]
36        \definefontsynonym [\s!Sans]           [\s!file:newcmsans10-regular.otf]     [\s!features=\s!default,\s!fallbacks=\s!Sans]
37        \definefontsynonym [\s!SansBold]       [\s!file:newcmsans10-bold.otf]        [\s!features=\s!default,\s!fallbacks=\s!SansBold]
38        \definefontsynonym [\s!SansItalic]     [\s!file:newcmsans10-oblique.otf]     [\s!features=\s!default,\s!fallbacks=\s!SansItalic]
39        \definefontsynonym [\s!SansBoldItalic] [\s!file:newcmsans10-boldoblique.otf] [\s!features=\s!default,\s!fallbacks=\s!SansBoldItalic]
40    \stoptypescript
41
42    \starttypescript [\s!mono] [newcomputermodern] [\s!name]
43        \setups[\s!font:\s!fallback:\s!mono]
44        \definefontsynonym [\s!Mono]           [\s!file:newcmmono10-regular.otf]     [\s!features=\s!none,\s!fallbacks=\s!Mono]
45        \definefontsynonym [\s!MonoBold]       [\s!file:newcmmono10-bold.otf]        [\s!features=\s!none,\s!fallbacks=\s!MonoBold]
46        \definefontsynonym [\s!MonoItalic]     [\s!file:newcmmono10-italic.otf]      [\s!features=\s!none,\s!fallbacks=\s!MonoItalic]
47        \definefontsynonym [\s!MonoBoldItalic] [\s!file:newcmmono10-boldoblique.otf] [\s!features=\s!none,\s!fallbacks=\s!MonoBoldItalic]
48    \stoptypescript
49
50    \starttypescript [\s!math][newcomputermodern] [\s!name]
51      % \loadfontgoodies[newcomputermodern-math] ,\s!goodies=newcomputermodern-math
52        \definefontsynonym[\s!MathRoman]    [\s!file:newcmmath-regular][\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=newcomputermodern-math]
53        \definefontsynonym[\s!MathRomanBold][\s!file:newcmmath-regular][\s!features={\s!math\mathsizesuffix,newcomputermodern-math-bold,mathextra},\s!goodies=newcomputermodern-math]
54    \stoptypescript
55
56    \starttypescript [\s!serif] [newcomputermodern-book] [\s!name]
57        \setups[\s!font:\s!fallback:\s!serif]
58        \definefontsynonym [\s!Serif]           [\s!file:newcm10-book.otf]       [\s!features=\s!default,\s!fallbacks=\s!Serif,\s!goodies=newcomputermodern-text]
59        \definefontsynonym [\s!SerifBold]       [\s!file:newcm10-bold.otf]       [\s!features=\s!default,\s!fallbacks=\s!SerifBold,\s!goodies=newcomputermodern-text]
60        \definefontsynonym [\s!SerifItalic]     [\s!file:newcm10-bookitalic.otf] [\s!features=\s!default,\s!fallbacks=\s!SerifItalic,\s!goodies=newcomputermodern-text]
61        \definefontsynonym [\s!SerifBoldItalic] [\s!file:newcm10-bolditalic.otf] [\s!features=\s!default,\s!fallbacks=\s!SerifBoldItalic,\s!goodies=newcomputermodern-text]
62    \stoptypescript
63
64    \starttypescript [\s!sans] [newcomputermodern-book] [\s!name]
65        \setups[\s!font:\s!fallback:\s!sans]
66        \definefontsynonym [\s!Sans]           [\s!file:newcmsans10-book.otf]        [\s!features=\s!default,\s!fallbacks=\s!Sans]
67        \definefontsynonym [\s!SansBold]       [\s!file:newcmsans10-bold.otf]        [\s!features=\s!default,\s!fallbacks=\s!SansBold]
68        \definefontsynonym [\s!SansItalic]     [\s!file:newcmsans10-bookoblique.otf] [\s!features=\s!default,\s!fallbacks=\s!SansItalic]
69        \definefontsynonym [\s!SansBoldItalic] [\s!file:newcmsans10-boldoblique.otf] [\s!features=\s!default,\s!fallbacks=\s!SansBoldItalic]
70    \stoptypescript
71
72    \starttypescript [\s!mono] [newcomputermodern-book] [\s!name]
73        \setups[\s!font:\s!fallback:\s!mono]
74        \definefontsynonym [\s!Mono]           [\s!file:newcmmono10-book.otf]        [\s!features=\s!none,\s!fallbacks=\s!Mono]
75        \definefontsynonym [\s!MonoBold]       [\s!file:newcmmono10-bold.otf]        [\s!features=\s!none,\s!fallbacks=\s!MonoBold]
76        \definefontsynonym [\s!MonoItalic]     [\s!file:newcmmono10-bookitalic.otf]  [\s!features=\s!none,\s!fallbacks=\s!MonoItalic]
77        \definefontsynonym [\s!MonoBoldItalic] [\s!file:newcmmono10-boldoblique.otf] [\s!features=\s!none,\s!fallbacks=\s!MonoBoldItalic]
78    \stoptypescript
79
80    \starttypescript [\s!math][newcomputermodern-book] [\s!name]
81      % \loadfontgoodies[newcomputermodern-math] ,\s!goodies=newcomputermodern-math
82        \definefontsynonym[\s!MathRoman]    [\s!file:newcmmath-book][\s!features={\s!math\mathsizesuffix,newcm-mathextra,mathextra},\s!goodies=newcomputermodern-math]
83        \definefontsynonym[\s!MathRomanBold][\s!file:newcmmath-book][\s!features={\s!math\mathsizesuffix,newcm-mathextra,newcomputermodern-math-bold,mathextra},\s!goodies=newcomputermodern-math]
84    \stoptypescript
85
86    \starttypescript[newcomputermodern,newcomputermodern-book]
87        \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default]
88        \definetypeface [\typescriptone] [\s!ss] [\s!sans]  [\typescriptone] [\s!default]
89        \definetypeface [\typescriptone] [\s!tt] [\s!mono]  [\typescriptone] [\s!default]
90        \definetypeface [\typescriptone] [\s!mm] [\s!math]  [\typescriptone] [\s!default]
91    \stoptypescript
92
93\stoptypescriptcollection
94