xits-math.lfg /size: 5528 b    last modification: 2023-12-21 09:44
1-- When testing XITS in LMTX one has to do this:
2--
3-- \definefilesynonym [type-imp-xits.mkiv] [type-imp-xits.mkiv]
4
5local common  = fonts.goodies.load("common-math.lfg")
6local presets = common.mathematics.tweaks.presets
7
8return {
9    name = "xits-math",
10    version = "1.00",
11    comment = "Goodies that complement xits (by Khaled Hosny).",
12    author = "Hans Hagen & Mikael Sundqvist",
13    copyright = "ConTeXt development team",
14    filenames = {
15        ["xitsmath-regular.otf"] = {
16            "xitsmath-regular.otf",
17            "xits-math.otf",
18        },
19        ["xitsmath-bold.otf"] = {
20            "xitsmath-bold.otf",
21            "xits-mathbold.otf",
22        },
23    },
24    mathematics = {
25        parameters = {
26            NoLimitSupFactor                =    0,
27            NoLimitSubFactor                = 1000,
28         -- AccentBaseHeight                =    0,
29            AccentBaseDepth                 =   30,
30            FlattenedAccentTopShiftUp       =   0, -- now also set, the wide ones (so we can move in one go)
31         -- AccentExtendMargin              =   50,
32            RadicalDegreeBottomRaisePercent =   65,
33         -- RadicalKernBeforeDegree         =  500,
34            RadicalKernAfterDegree          = -500,
35            RadicalVerticalGap              =   10,
36         -- RadicalRuleThickness            =   68, -- 68 in font (but shifted down)
37            DelimiterPercent                =   90,
38            DelimiterShortfall              =  400,
39            DisplayOperatorMinHeight        = 1800, -- 1800 in font
40            PrimeRaisePercent               =   75, -- 50 default
41            PrimeRaiseComposedPercent       =   10, -- 25 default
42
43        },
44        tweaks = {
45            aftercopying = {
46                {
47                    tweak    = "version",
48                    expected = "Version 1.302",
49                },
50                {
51                    tweak   = "replacealphabets",
52                    list    = {
53                        {
54                            source   = "uppercasescript",
55                            target   = "uppercasecalligraphic",
56                        },
57                        {
58                            source   = "uppercasescript",
59                            target   = "uppercasescript",
60                            feature  = "ss01",
61                        },
62                    },
63                },
64                presets.scripttocalligraphic { },
65                presets.rsfstoscript         { rscale  = 0.95 },
66                presets.rsfsuprighttoscript  { rscale  = 0.95 },
67                presets.moderntocalligraphic { rscale  = 0.95 },
68                presets.eulertocalligraphic  { rscale  = 0.95 },
69                presets.xitsarabic           { rscale  = 0.88 },
70                presets.fallbacks            { },
71                presets.moveitalics          { correct = true },
72                presets.moveitalics          { correct = true, letters = true },
73                presets.moveintegrals        { factor = 1.4 },
74                presets.wipeitalics          { },
75                {
76                    tweak = "kerns",
77                    list  = {
78                        [0x2F] = {
79                            topleft     = -0.1,
80                         -- bottomleft  =  0,
81                         -- topright    =  0,
82                            bottomright =  -0.1,
83                       },
84                    },
85                },
86                {
87                    tweak = "dimensions",
88                    list  = {
89                        -- nothing yet
90                    },
91                },
92                {
93                    tweak  = "fixprimes",
94                 -- smaller = true,
95                    factor = 0.85,
96                },
97                {
98                    tweak = "checkspacing",
99                },
100                {
101                    tweak = "addscripts",
102                },
103                {
104                    tweak = "accentdimensions",
105                },
106                {
107                    tweak = "addrules",
108                },
109                {
110                    tweak = "setoptions",
111                    set   = { "ignorekerndimensions" }
112                },
113                -- this is the mkiv section
114                {
115                    tweak   = "emulatelmtx",
116                    feature = "emulatelmtx",
117                    comment = "this is for mkiv",
118                },
119            },
120        },
121        alternates = {
122            calligraphic = { feature = 'ss01', value = 1, comment = "Mathematical Calligraphic Alphabet" },
123            greekssup    = { feature = 'ss02', value = 1, comment = "Mathematical Greek Sans Serif Alphabet" },
124            greekssit    = { feature = 'ss03', value = 1, comment = "Mathematical Italic Sans Serif Digits" },
125            monobfnum    = { feature = 'ss04', value = 1, comment = "Mathematical Bold Monospace Digits" },
126            mathbbbf     = { feature = 'ss05', value = 1, comment = "Mathematical Bold Double-Struck Alphabet" },
127            mathbbit     = { feature = 'ss06', value = 1, comment = "Mathematical Italic Double-Struck Alphabet" },
128            mathbbbi     = { feature = 'ss07', value = 1, comment = "Mathematical Bold Italic Double-Struck Alphabet" },
129            upint        = { feature = 'ss08', value = 1, comment = "Upright Integrals" },
130            vertnot      = { feature = 'ss09', value = 1, comment = "Negated Symbols With Vertical Stroke" },
131        },
132    }
133}
134