type-imp-xcharter.mkiv /size: 3997 b    last modification: 2024-01-16 10:22
1%D \module
2%D   [       file=type-imp-xcharter,
3%D        version=2022.30.09, % a bit older
4%D          title=\CONTEXT\ Typescript Macros,
5%D       subtitle=XCharter fonts,
6%D         author=Mikael Sundqvist,
7%D           date=\currentdate,
8%D      copyright={\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\starttypescriptcollection[xcharter]
15
16    \pushglobalsetups
17        \startsetups[xcharter]
18            \setupmathradical[\c!leftmargin=.05mq,mindepth=0.1mx]%
19        \stopsetups
20    \popglobalsetups
21
22    % \definefontfeature[default-slanted-xcharter][default][slant=.2]
23    % \definefontfeature[none-slanted-xcharter]   [none]   [slant=.2]
24
25    \doifunknownfontfeature {xcharter-math-bold} {\definefontfeature[xcharter-math-bold][boldened]}
26
27    \starttypescript [\s!serif] [xcharter] [\s!name]
28        \definefontsynonym [\s!Serif]           [\s!file:XCharter-Roman]      [\s!features=\s!default,\s!goodies=xcharter-text]
29        \definefontsynonym [\s!SerifItalic]     [\s!file:XCharter-Italic]     [\s!features=\s!default,\s!goodies=xcharter-text]
30        \definefontsynonym [\s!SerifSlanted]    [\s!file:XCharter-Slanted]    [\s!features=\s!default]
31        \definefontsynonym [\s!SerifBold]       [\s!file:XCharter-Bold]       [\s!features=\s!default,\s!goodies=xcharter-text]
32        \definefontsynonym [\s!SerifBoldItalic] [\s!file:xcharter-BoldItalic] [\s!features=\s!default,\s!goodies=xcharter-text]
33        \definefontsynonym [\s!SerifBoldSlanted][\s!file:XCharter-BoldSlanted][\s!features=\s!default]
34    \stoptypescript
35
36    \starttypescript [\s!sans] [cabin] [\s!name]
37        \setups[\s!font:\s!fallback:\s!sans]
38        \definefontsynonym [\s!Sans]          [\s!file:Cabin-Regular]       [\s!features=\s!default]
39        \definefontsynonym [\s!SansItalic]    [\s!file:Cabin-Italic]        [\s!features=\s!default]
40        \definefontsynonym [\s!SansBold]      [\s!file:Cabin-SemiBold]      [\s!features=\s!default]
41        \definefontsynonym [\s!SansBoldItalic][\s!file:Cabin-SemiBoldItalic][\s!features=\s!default]
42    \stoptypescript
43
44    \starttypescript [\s!mono] [inconsolata] [\s!name]
45        \setups[\s!font:\s!fallback:\s!mono]
46        \definefontsynonym [\s!Mono]    [\s!file:Inconsolatazi4-Regular][\s!features=\s!none]
47        \definefontsynonym [\s!MonoBold][\s!file:Inconsolatazi4-Bold]   [\s!features=\s!none]
48    \stoptypescript
49
50    \starttypescript [\s!math] [xcharter,xcharter-nt][\s!name]
51        \checkedmapfontsize[\typescripttwo][\s!script]      [.70]
52        \checkedmapfontsize[\typescripttwo][\s!scriptscript][.55]
53    \stoptypescript
54
55    \starttypescript [\s!math] [xcharter][\s!name]
56        \definefontsynonym [\s!MathRoman]    [\s!file:XCharter-Math.otf][\s!features={\s!math\mathsizesuffix,xcharter:mathextra,mathextra},\s!goodies=xcharter-math]
57        \definefontsynonym [\s!MathRomanBold][\s!file:XCharter-Math.otf][\s!features={\s!math\mathsizesuffix,xcharter-math-bold,xcharter:mathextra,mathextra},\s!goodies=xcharter-math]
58    \stoptypescript
59
60    \starttypescript [\s!math] [xcharter-nt] [\s!name]
61        \definefontsynonym [\s!MathRoman]    [\s!file:XCharter-Math.otf][\s!features={\s!math\mathsizesuffix,xcharter:mathextra,mathextra}]
62        \definefontsynonym [\s!MathRomanBold][\s!file:XCharter-Math.otf][\s!features={\s!math\mathsizesuffix,xcharter-math-bold,xcharter:mathextra,mathextra}]
63    \stoptypescript
64
65    \starttypescript [xcharter,xcharter-nt]
66        \definetypeface [\typescriptone] [\s!rm] [\s!serif] [xcharter]       [\s!default]
67        \definetypeface [\typescriptone] [\s!ss] [\s!sans]  [cabin]          [\s!default]
68        \definetypeface [\typescriptone] [\s!tt] [\s!mono]  [inconsolata]    [\s!default] [\s!rscale=1.1]
69        \definetypeface [\typescriptone] [\s!mm] [\s!math]  [\typescriptone] [\s!default]
70        \quittypescriptscanning
71    \stoptypescript
72
73\stoptypescriptcollection
74