type-imp-stix.mkiv /size: 4418 b    last modification: 2023-12-21 09:44
1%D \module
2%D   [       file=type-otf,
3%D        version=2007.07.30,
4%D          title=\CONTEXT\ Typescript Macros,
5%D       subtitle=Stix,
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 We provide typescripts for version one and two of the stix fonts. There is a
15%D xits variant based on the first (not opentype) release that also provides
16%D bidirectional math. With (in 2022) stixtwo being frozsen for 2 years we can make
17%D these the default now.
18%D
19%D Users should be aware of the fact that the stix filenames keep changing so if
20%D something fails, make sure you have the files and that the names below match
21%D those on your system. In \TEX\ distributions there's 2 and Two and math can have
22%D -Regular appended or not. You can expect the \CONTEXT\ distribution to be kept up
23%D to date.
24%D
25%D Per november 2022 we swithched from \OPENTYPE\ (otf) files to \TRUETYPE\ (ttf)
26%D files. The main reason is that the metrics are cleaner, especially when one peeks
27%D into the font for the purpose tweaking math (boundingbox, true positioning
28%D unaffected by excessive hinting shown in in FontForge). It is yet unclear to us
29%D (MS & HH) why there is this difference, but it might relate to the toolchain used
30%D for generating these fonts. We might even switch to (smaller) unhinted \TRUETYPE\
31%D fonts at some point but then we need to generate them ourselves). Anyway, the end
32%D results are the same but we just want to be able to view it right.
33
34\definefontfeature
35  [stixtwomath]
36  [ss02=yes] % otherwise weird (non italic) g
37
38\definefontfeature[stixtwomath][copymathscripts=yes] % see lfg file
39
40\starttypescriptcollection[stix]
41
42    \doifunknownfontfeature {stixtwo-math-bold} {\definefontfeature[stixtwo-math-bold][boldened]}
43
44    \starttypescript [\s!math] [stix,stixtwo,stix-nt,stixtwo-nt,xits]
45        \checkedmapfontsize[\typescripttwo][\s!script]      [.70]
46        \checkedmapfontsize[\typescripttwo][\s!scriptscript][.55]
47    \stoptypescript
48
49    \starttypescript [\s!math] [stix,stixtwo,xits] [\s!name]
50        \definefontsynonym[\s!MathRoman]    [\s!file:stixtwomath-regular.ttf][\s!features={\s!math\mathsizesuffix,stixtwomath,stixtwo:mathextra,mathextra},\s!goodies=stixtwo-math]
51        \definefontsynonym[\s!MathRomanBold][\s!file:stixtwomath-regular.ttf][\s!features={\s!math\mathsizesuffix,stixtwo-math-bold,stixtwomath,stixtwo:mathextra,mathextra},\s!goodies=stixtwo-math]
52    \stoptypescript
53
54    \starttypescript [\s!math] [stix-nt,stixtwo-nt] [\s!name]
55        \definefontsynonym[\s!MathRoman][\s!file:stixtwomath-regular.ttf][\s!features={\s!math\mathsizesuffix,stixtwomath,stixtwo:mathextra,mathextra}]
56        \definefontsynonym[\s!MathRomanBold][\s!file:stixtwomath-regular.ttf][\s!features={\s!math\mathsizesuffix,stixtwo-math-bold,stixtwomath,stixtwo:mathextra,mathextra}]
57    \stoptypescript
58
59    \starttypescript [\s!serif] [stix,stixtwo,xits] [\s!name]
60        \setups[\s!font:\s!fallback:\s!serif]
61        \definefontsynonym[\s!Serif]          [\s!file:stixtwotext-regular.ttf]   [\s!features=\s!default,\s!goodies=stixtwo-text]
62        \definefontsynonym[\s!SerifBold]      [\s!file:stixtwotext-bold.ttf]      [\s!features=\s!default,\s!goodies=stixtwo-text]
63        \definefontsynonym[\s!SerifItalic]    [\s!file:stixtwotext-italic.ttf]    [\s!features=\s!default,\s!goodies=stixtwo-text]
64        \definefontsynonym[\s!SerifBoldItalic][\s!file:stixtwotext-bolditalic.ttf][\s!features=\s!default,\s!goodies=stixtwo-text]
65    \stoptypescript
66
67    \starttypescript[stix,stixtwo,xits,stix-nt,stixtwo-nt]
68        \definetypeface [\typescriptone] [\s!rm] [\s!serif] [stixtwo]    [\s!default]
69        \definetypeface [\typescriptone] [\s!ss] [\s!serif] [stixtwo]    [\s!default]
70        \definetypeface [\typescriptone] [\s!tt] [\s!mono]  [dejavu]     [\s!default] [\s!rscale=0.895]
71    \stoptypescript
72    \starttypescript[stix,stixtwo,xits]
73        \definetypeface [\typescriptone] [\s!mm] [\s!math]  [stixtwo]    [\s!default] [\s!direction=\s!both]
74    \stoptypescript
75    \starttypescript[stix-nt,stixtwo-nt]
76        \definetypeface [\typescriptone] [\s!mm] [\s!math]  [stixtwo-nt] [\s!default] [\s!direction=\s!both]
77    \stoptypescript
78
79\stoptypescriptcollection
80