lm-math.lfg /size: 11 Kb    last modification: 2023-12-21 09:44
1-- we could consider taking more from 'tex-mr-missing'
2
3-- This patch code is moved from font-pat.lua to this goodies
4-- files as it does not belong in the core code.
5
6-- This patch is no longer needed but we keep it commented as
7-- it is an example.
8--
9-- local patches = fonts.handlers.otf.enhancers.patches
10--
11-- local function patch(data,filename)
12--     local uni_to_ind = data.map.map
13--     if not uni_to_ind[0x391] then
14--         -- beware, this is a hack, features for latin often don't apply to greek
15--         -- but lm has not much features anyway (and only greek for math)
16--         patches.report("adding 13 greek capitals")
17--         uni_to_ind[0x391] = uni_to_ind[0x41]
18--         uni_to_ind[0x392] = uni_to_ind[0x42]
19--         uni_to_ind[0x395] = uni_to_ind[0x45]
20--         uni_to_ind[0x397] = uni_to_ind[0x48]
21--         uni_to_ind[0x399] = uni_to_ind[0x49]
22--         uni_to_ind[0x39A] = uni_to_ind[0x4B]
23--         uni_to_ind[0x39C] = uni_to_ind[0x4D]
24--         uni_to_ind[0x39D] = uni_to_ind[0x4E]
25--         uni_to_ind[0x39F] = uni_to_ind[0x4F]
26--         uni_to_ind[0x3A1] = uni_to_ind[0x52]
27--         uni_to_ind[0x3A4] = uni_to_ind[0x54]
28--         uni_to_ind[0x3A7] = uni_to_ind[0x58]
29--         uni_to_ind[0x396] = uni_to_ind[0x5A]
30--     end
31-- end
32--
33-- patches.register("before","check extra features","^lmroman",     patch)
34-- patches.register("before","check extra features","^lmsans",      patch)
35-- patches.register("before","check extra features","^lmtypewriter",patch)
36
37-- rm-lmr5  : LMMathRoman5-Regular
38-- rm-lmbx5 : LMMathRoman5-Bold          ]
39-- lmbsy5   : LMMathSymbols5-BoldItalic
40-- lmsy5    : LMMathSymbols5-Italic
41-- lmmi5    : LMMathItalic5-Italic
42-- lmmib5   : LMMathItalic5-BoldItalic
43
44local five = {
45    { name = "lmroman5-regular.otf", features = "virtualmath", main = true },
46    { name = "rm-lmr5.tfm", vector = "tex-mr-missing" } ,
47    { name = "lmmi5.tfm", vector = "tex-mi", skewchar = 0x7F },
48    { name = "lmmi5.tfm", vector = "tex-it", skewchar = 0x7F },
49    { name = "lmsy5.tfm", vector = "tex-sy", skewchar = 0x30, parameters = true } ,
50    { name = "lmex10.tfm", vector = "tex-ex", extension = true } ,
51    { name = "msam5.tfm", vector = "tex-ma" },
52    { name = "msbm5.tfm", vector = "tex-mb" },
53    { name = "stmary10.afm", vector = "tex-mc" },
54 -- { name = "rm-lmbx5.tfm", vector = "tex-bf" } ,
55    { name = "lmroman5-bold", vector = "tex-bf" } ,
56    { name = "lmmib5.tfm", vector = "tex-bi", skewchar = 0x7F } ,
57    { name = "lmsans8-regular.otf", vector = "tex-ss", optional = true },
58    { name = "lmmono8-regular.otf", vector = "tex-tt", optional = true },
59    { name = "eufm5.tfm", vector = "tex-fraktur", optional = true },
60}
61
62-- rm-lmr6  : LMMathRoman6-Regular
63-- rm-lmbx6 : LMMathRoman6-Bold
64-- lmsy6    : LMMathSymbols6-Italic
65-- lmmi6    : LMMathItalic6-Italic
66
67local six = {
68    { name = "lmroman6-regular.otf", features = "virtualmath", main = true },
69    { name = "rm-lmr6.tfm", vector = "tex-mr-missing" } ,
70    { name = "lmmi6.tfm", vector = "tex-mi", skewchar = 0x7F },
71    { name = "lmmi6.tfm", vector = "tex-it", skewchar = 0x7F },
72    { name = "lmsy6.tfm", vector = "tex-sy", skewchar = 0x30, parameters = true } ,
73    { name = "lmex10.tfm", vector = "tex-ex", extension = true } ,
74    { name = "msam5.tfm", vector = "tex-ma" },
75    { name = "msbm5.tfm", vector = "tex-mb" },
76    { name = "stmary10.afm", vector = "tex-mc" },
77 -- { name = "rm-lmbx6.tfm", vector = "tex-bf" } ,
78    { name = "lmroman6-bold.otf", vector = "tex-bf" } ,
79    { name = "lmmib5.tfm", vector = "tex-bi", skewchar = 0x7F } ,
80    { name = "lmsans8-regular.otf", vector = "tex-ss", optional = true },
81    { name = "lmmono8-regular.otf", vector = "tex-tt", optional = true },
82    { name = "eufm5.tfm", vector = "tex-fraktur", optional = true },
83    { name = "eufb5.tfm", vector = "tex-fraktur-bold", optional = true },
84}
85
86-- rm-lmr7  : LMMathRoman7-Regular
87-- rm-lmbx7 : LMMathRoman7-Bold
88-- lmbsy7   : LMMathSymbols7-BoldItalic
89-- lmsy7    : LMMathSymbols7-Italic
90-- lmmi7    : LMMathItalic7-Italic
91-- lmmib7   : LMMathItalic7-BoldItalic
92
93local seven = {
94    { name = "lmroman7-regular.otf", features = "virtualmath", main = true },
95    { name = "rm-lmr7.tfm", vector = "tex-mr-missing" } ,
96    { name = "lmmi7.tfm", vector = "tex-mi", skewchar = 0x7F },
97    { name = "lmmi7.tfm", vector = "tex-it", skewchar = 0x7F },
98    { name = "lmsy7.tfm", vector = "tex-sy", skewchar = 0x30, parameters = true } ,
99    { name = "lmex10.tfm", vector = "tex-ex", extension = true } ,
100    { name = "msam7.tfm", vector = "tex-ma" },
101    { name = "msbm7.tfm", vector = "tex-mb" },
102    { name = "stmary10.afm", vector = "tex-mc" },
103 -- { name = "rm-lmbx7.tfm", vector = "tex-bf" } ,
104    { name = "lmroman7-bold.otf", vector = "tex-bf" } ,
105    { name = "lmmib7.tfm", vector = "tex-bi", skewchar = 0x7F } ,
106    { name = "lmsans8-regular.otf", vector = "tex-ss", optional = true },
107    { name = "lmmono8-regular.otf", vector = "tex-tt", optional = true },
108    { name = "eufm7.tfm", vector = "tex-fraktur", optional = true },
109    { name = "eufb7.tfm", vector = "tex-fraktur-bold", optional = true },
110}
111
112-- rm-lmr8  : LMMathRoman8-Regular
113-- rm-lmbx8 : LMMathRoman8-Bold
114-- lmsy8    : LMMathSymbols8-Italic
115-- lmmi8    : LMMathItalic8-Italic
116
117local eight = {
118    { name = "lmroman8-regular.otf", features = "virtualmath", main = true },
119    { name = "rm-lmr8.tfm", vector = "tex-mr-missing" } ,
120    { name = "lmmi8.tfm", vector = "tex-mi", skewchar = 0x7F },
121    { name = "lmmi8.tfm", vector = "tex-it", skewchar = 0x7F },
122    { name = "lmsy8.tfm", vector = "tex-sy", skewchar = 0x30, parameters = true } ,
123    { name = "lmex10.tfm", vector = "tex-ex", extension = true } ,
124    { name = "msam7.tfm", vector = "tex-ma" },
125    { name = "msbm7.tfm", vector = "tex-mb" },
126    { name = "stmary10.afm", vector = "tex-mc" },
127 -- { name = "rm-lmbx8.tfm", vector = "tex-bf" } ,
128    { name = "lmroman8-bold.otf", vector = "tex-bf" } ,
129    { name = "lmmib7.tfm", vector = "tex-bi", skewchar = 0x7F } ,
130    { name = "lmsans8-regular.otf", vector = "tex-ss", optional = true },
131    { name = "lmmono8-regular.otf", vector = "tex-tt", optional = true },
132    { name = "eufm7.tfm", vector = "tex-fraktur", optional = true },
133    { name = "eufb7.tfm", vector = "tex-fraktur-bold", optional = true },
134}
135
136-- rm-lmr9  : LMMathRoman9-Regular
137-- rm-lmbx9 : LMMathRoman9-Bold
138-- lmsy9    : LMMathSymbols9-Italic
139-- lmmi9    : LMMathItalic9-Italic
140
141local nine = {
142    { name = "lmroman9-regular.otf", features = "virtualmath", main = true },
143    { name = "rm-lmr9.tfm", vector = "tex-mr-missing" } ,
144    { name = "lmmi9.tfm", vector = "tex-mi", skewchar = 0x7F },
145    { name = "lmmi9.tfm", vector = "tex-it", skewchar = 0x7F },
146    { name = "lmsy9.tfm", vector = "tex-sy", skewchar = 0x30, parameters = true } ,
147    { name = "lmex10.tfm", vector = "tex-ex", extension = true } ,
148    { name = "msam10.tfm", vector = "tex-ma" },
149    { name = "msbm10.tfm", vector = "tex-mb" },
150    { name = "stmary10.afm", vector = "tex-mc" },
151 -- { name = "rm-lmbx9.tfm", vector = "tex-bf" } ,
152    { name = "lmroman9-bold.otf", vector = "tex-bf" } ,
153    { name = "lmmib10.tfm", vector = "tex-bi", skewchar = 0x7F } ,
154    { name = "lmsans9-regular.otf", vector = "tex-ss", optional = true },
155    { name = "lmmono9-regular.otf", vector = "tex-tt", optional = true },
156    { name = "eufm10.tfm", vector = "tex-fraktur", optional = true },
157    { name = "eufb10.tfm", vector = "tex-fraktur-bold", optional = true },
158}
159
160-- rm-lmr10  : LMMathRoman10-Regular
161-- rm-lmbx10 : LMMathRoman10-Bold
162-- lmbsy10   : LMMathSymbols10-BoldItalic
163-- lmsy10    : LMMathSymbols10-Italic
164-- lmex10    : LMMathExtension10-Regular
165-- lmmi10    : LMMathItalic10-Italic
166-- lmmib10   : LMMathItalic10-BoldItalic
167
168local ten = {
169    { name = "lmroman10-regular.otf", features = "virtualmath", main = true },
170    { name = "rm-lmr10.tfm", vector = "tex-mr-missing" } ,
171    { name = "lmmi10.tfm", vector = "tex-mi", skewchar = 0x7F },
172    { name = "lmmi10.tfm", vector = "tex-it", skewchar = 0x7F },
173    { name = "lmsy10.tfm", vector = "tex-sy", skewchar = 0x30, parameters = true } ,
174    { name = "lmex10.tfm", vector = "tex-ex", extension = true } ,
175    { name = "msam10.tfm", vector = "tex-ma" },
176    { name = "msbm10.tfm", vector = "tex-mb" },
177    { name = "stmary10.afm", vector = "tex-mc" },
178 -- { name = "rm-lmbx10.tfm", vector = "tex-bf" } ,
179    { name = "lmroman10-bold.otf", vector = "tex-bf" } ,
180    { name = "lmmib10.tfm", vector = "tex-bi", skewchar = 0x7F } ,
181    { name = "lmsans10-regular.otf", vector = "tex-ss", optional = true },
182    { name = "lmmono10-regular.otf", vector = "tex-tt", optional = true },
183    { name = "eufm10.tfm", vector = "tex-fraktur", optional = true },
184    { name = "eufb10.tfm", vector = "tex-fraktur-bold", optional = true },
185}
186
187-- rm-lmr12  : LMMathRoman12-Regular
188-- rm-lmbx12 : LMMathRoman12-Bold
189-- lmmi12    : LMMathItalic12-Italic
190
191local twelve = {
192    { name = "lmroman12-regular.otf", features = "virtualmath", main = true },
193    { name = "rm-lmr12.tfm", vector = "tex-mr-missing" },
194    { name = "lmmi12.tfm", vector = "tex-mi", skewchar = 0x7F },
195    { name = "lmmi12.tfm", vector = "tex-it", skewchar = 0x7F },
196    { name = "lmsy10.tfm", vector = "tex-sy", skewchar = 0x30, parameters = true } ,
197    { name = "lmex10.tfm", vector = "tex-ex", extension = true } ,
198    { name = "msam10.tfm", vector = "tex-ma" },
199    { name = "msbm10.tfm", vector = "tex-mb" },
200    { name = "stmary10.afm", vector = "tex-mc" },
201 -- { name = "rm-lmbx12.tfm", vector = "tex-bf" } ,
202    { name = "lmroman12-bold.otf", vector = "tex-bf" } ,
203    { name = "lmmib10.tfm", vector = "tex-bi", skewchar = 0x7F } ,
204    { name = "lmsans12-regular.otf", vector = "tex-ss", optional = true },
205    { name = "lmmono12-regular.otf", vector = "tex-tt", optional = true },
206    { name = "eufm10.tfm", vector = "tex-fraktur", optional = true },
207    { name = "eufb10.tfm", vector = "tex-fraktur-bold", optional = true },
208}
209
210-- rm-lmr17 : LMMathRoman17-Regular
211
212local seventeen = {
213    { name = "lmroman17-regular.otf", features = "virtualmath", main = true },
214    { name = "rm-lmr12.tfm", vector = "tex-mr-missing" } ,
215    { name = "lmmi12.tfm", vector = "tex-mi", skewchar = 0x7F },
216    { name = "lmmi12.tfm", vector = "tex-it", skewchar = 0x7F },
217    { name = "lmsy10.tfm", vector = "tex-sy", skewchar = 0x30, parameters = true } ,
218    { name = "lmex10.tfm", vector = "tex-ex", extension = true } ,
219    { name = "msam10.tfm", vector = "tex-ma" },
220    { name = "msbm10.tfm", vector = "tex-mb" },
221    { name = "stmary10.afm", vector = "tex-mc" },
222 -- { name = "rm-lmbx12.tfm", vector = "tex-bf" } ,
223    { name = "lmroman12-bold.otf", vector = "tex-bf" } ,
224    { name = "lmmib10.tfm", vector = "tex-bi", skewchar = 0x7F } ,
225    { name = "lmsans17-regular.otf", vector = "tex-ss", optional = true },
226    { name = "lmmono17-regular.otf", vector = "tex-tt", optional = true },
227    { name = "eufm10.tfm", vector = "tex-fraktur", optional = true },
228    { name = "eufb10.tfm", vector = "tex-fraktur-bold", optional = true },
229}
230
231return {
232    name = "lm-math",
233    version = "1.00",
234    comment = "Goodies that complement latin modern math (virtual).",
235    author = "Hans Hagen",
236    copyright = "ConTeXt development team",
237    mathematics = {
238        parameters = {
239            NoLimitSupFactor =   0,
240            NoLimitSubFactor = 900,
241        },
242        mapfiles = {
243            "lm-math.map",
244            "lm-rm.map",
245            "mkiv-base.map",
246        },
247        virtuals = {
248            ["lmroman5-math"]  = five,
249            ["lmroman6-math"]  = six,
250            ["lmroman7-math"]  = seven,
251            ["lmroman8-math"]  = eight,
252            ["lmroman9-math"]  = nine,
253            ["lmroman10-math"] = ten,
254            ["lmroman12-math"] = twelve,
255            ["lmroman17-math"] = seventeen,
256        },
257        variables = {
258            joinrelfactor = 3, -- default anyway
259        },
260    }
261}
262