rapier-math 0.0.0-stage → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +484 -0
- package/LICENSE-MIT +21 -0
- package/README.md +110 -2
- package/check.mjs +97 -0
- package/index.mjs +2953 -0
- package/math-LICENSE.txt +21 -0
- package/math-components.json +71 -0
- package/math-font-LICENSE.txt +457 -0
- package/package.json +44 -4
- package/rapier-math-1.0.2.js +2952 -0
- package/src/math/FONT-LICENSE.txt +457 -0
- package/src/math/FONT-SOURCE.md +143 -0
- package/src/math/LICENSE-MIT +21 -0
- package/src/math/api.js +87 -0
- package/src/math/browser.js +181 -0
- package/src/math/build-font.py +622 -0
- package/src/math/fallbacks.js +111 -0
- package/src/math/font.js +547 -0
- package/src/math/layout.js +580 -0
- package/src/math/package-build.mjs +27 -0
- package/src/math/package-verify.mjs +40 -0
- package/src/math/parser.js +1064 -0
- package/src/math/responsive.js +251 -0
- package/src/math/symbols.js +98 -0
- package/src/package.json +9 -0
- package/src/shell/math-resources.json +105 -0
- package/src/tools/build-math.mjs +95 -0
- package/verify.mjs +40 -0
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
Copyright 2012--2014 for Latin Modern Math OTF by B. Jackowski, P. Strzelczyk and P. Pianowski (on behalf of TeX users groups). This work is released under the GUST Font License -- see http://tug.org/fonts/licenses/GUST-FONT-LICENSE.txt for details.
|
|
2
|
+
|
|
3
|
+
Rapier math font data, derived from Latin Modern Math 1.959.
|
|
4
|
+
Changes: SVG outline conversion, character and MATH data extraction,
|
|
5
|
+
optical-form closure, derived contour profiles and lossless path packing.
|
|
6
|
+
Original outlines are unchanged. Hinting and text shaping tables are omitted.
|
|
7
|
+
The font authors do not maintain this conversion.
|
|
8
|
+
Complete original work: https://mirrors.ctan.org/fonts/lm-math.zip
|
|
9
|
+
Conversion details: FONT-SOURCE.md.
|
|
10
|
+
|
|
11
|
+
% This is a preliminary version (2006-09-30), barring acceptance from
|
|
12
|
+
% the LaTeX Project Team and other feedback, of the GUST Font License.
|
|
13
|
+
% (GUST is the Polish TeX Users Group, http://www.gust.org.pl)
|
|
14
|
+
%
|
|
15
|
+
% For the most recent version of this license see
|
|
16
|
+
% http://www.gust.org.pl/fonts/licenses/GUST-FONT-LICENSE.txt
|
|
17
|
+
% or
|
|
18
|
+
% http://tug.org/fonts/licenses/GUST-FONT-LICENSE.txt
|
|
19
|
+
%
|
|
20
|
+
% This work may be distributed and/or modified under the conditions
|
|
21
|
+
% of the LaTeX Project Public License, either version 1.3c of this
|
|
22
|
+
% license or (at your option) any later version.
|
|
23
|
+
%
|
|
24
|
+
% Please also observe the following clause:
|
|
25
|
+
% 1) it is requested, but not legally required, that derived works be
|
|
26
|
+
% distributed only after changing the names of the fonts comprising this
|
|
27
|
+
% work and given in an accompanying "manifest", and that the
|
|
28
|
+
% files comprising the Work, as listed in the manifest, also be given
|
|
29
|
+
% new names. Any exceptions to this request are also given in the
|
|
30
|
+
% manifest.
|
|
31
|
+
%
|
|
32
|
+
% We recommend the manifest be given in a separate file named
|
|
33
|
+
% MANIFEST-<fontid>.txt, where <fontid> is some unique identification
|
|
34
|
+
% of the font family. If a separate "readme" file accompanies the Work,
|
|
35
|
+
% we recommend a name of the form README-<fontid>.txt.
|
|
36
|
+
%
|
|
37
|
+
% The latest version of the LaTeX Project Public License is in
|
|
38
|
+
% http://www.latex-project.org/lppl.txt and version 1.3c or later
|
|
39
|
+
% is part of all distributions of LaTeX version 2006/05/20 or later.
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
The LaTeX Project Public License
|
|
43
|
+
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
|
44
|
+
|
|
45
|
+
LPPL Version 1.3c 2008-05-04
|
|
46
|
+
|
|
47
|
+
Copyright 1999 2002-2008 LaTeX3 Project
|
|
48
|
+
Everyone is allowed to distribute verbatim copies of this
|
|
49
|
+
license document, but modification of it is not allowed.
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
PREAMBLE
|
|
53
|
+
========
|
|
54
|
+
|
|
55
|
+
The LaTeX Project Public License (LPPL) is the primary license under
|
|
56
|
+
which the LaTeX kernel and the base LaTeX packages are distributed.
|
|
57
|
+
|
|
58
|
+
You may use this license for any work of which you hold the copyright
|
|
59
|
+
and which you wish to distribute. This license may be particularly
|
|
60
|
+
suitable if your work is TeX-related (such as a LaTeX package), but
|
|
61
|
+
it is written in such a way that you can use it even if your work is
|
|
62
|
+
unrelated to TeX.
|
|
63
|
+
|
|
64
|
+
The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE',
|
|
65
|
+
below, gives instructions, examples, and recommendations for authors
|
|
66
|
+
who are considering distributing their works under this license.
|
|
67
|
+
|
|
68
|
+
This license gives conditions under which a work may be distributed
|
|
69
|
+
and modified, as well as conditions under which modified versions of
|
|
70
|
+
that work may be distributed.
|
|
71
|
+
|
|
72
|
+
We, the LaTeX3 Project, believe that the conditions below give you
|
|
73
|
+
the freedom to make and distribute modified versions of your work
|
|
74
|
+
that conform with whatever technical specifications you wish while
|
|
75
|
+
maintaining the availability, integrity, and reliability of
|
|
76
|
+
that work. If you do not see how to achieve your goal while
|
|
77
|
+
meeting these conditions, then read the document `cfgguide.tex'
|
|
78
|
+
and `modguide.tex' in the base LaTeX distribution for suggestions.
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
DEFINITIONS
|
|
82
|
+
===========
|
|
83
|
+
|
|
84
|
+
In this license document the following terms are used:
|
|
85
|
+
|
|
86
|
+
`Work'
|
|
87
|
+
Any work being distributed under this License.
|
|
88
|
+
|
|
89
|
+
`Derived Work'
|
|
90
|
+
Any work that under any applicable law is derived from the Work.
|
|
91
|
+
|
|
92
|
+
`Modification'
|
|
93
|
+
Any procedure that produces a Derived Work under any applicable
|
|
94
|
+
law -- for example, the production of a file containing an
|
|
95
|
+
original file associated with the Work or a significant portion of
|
|
96
|
+
such a file, either verbatim or with modifications and/or
|
|
97
|
+
translated into another language.
|
|
98
|
+
|
|
99
|
+
`Modify'
|
|
100
|
+
To apply any procedure that produces a Derived Work under any
|
|
101
|
+
applicable law.
|
|
102
|
+
|
|
103
|
+
`Distribution'
|
|
104
|
+
Making copies of the Work available from one person to another, in
|
|
105
|
+
whole or in part. Distribution includes (but is not limited to)
|
|
106
|
+
making any electronic components of the Work accessible by
|
|
107
|
+
file transfer protocols such as FTP or HTTP or by shared file
|
|
108
|
+
systems such as Sun's Network File System (NFS).
|
|
109
|
+
|
|
110
|
+
`Compiled Work'
|
|
111
|
+
A version of the Work that has been processed into a form where it
|
|
112
|
+
is directly usable on a computer system. This processing may
|
|
113
|
+
include using installation facilities provided by the Work,
|
|
114
|
+
transformations of the Work, copying of components of the Work, or
|
|
115
|
+
other activities. Note that modification of any installation
|
|
116
|
+
facilities provided by the Work constitutes modification of the Work.
|
|
117
|
+
|
|
118
|
+
`Current Maintainer'
|
|
119
|
+
A person or persons nominated as such within the Work. If there is
|
|
120
|
+
no such explicit nomination then it is the `Copyright Holder' under
|
|
121
|
+
any applicable law.
|
|
122
|
+
|
|
123
|
+
`Base Interpreter'
|
|
124
|
+
A program or process that is normally needed for running or
|
|
125
|
+
interpreting a part or the whole of the Work.
|
|
126
|
+
|
|
127
|
+
A Base Interpreter may depend on external components but these
|
|
128
|
+
are not considered part of the Base Interpreter provided that each
|
|
129
|
+
external component clearly identifies itself whenever it is used
|
|
130
|
+
interactively. Unless explicitly specified when applying the
|
|
131
|
+
license to the Work, the only applicable Base Interpreter is a
|
|
132
|
+
`LaTeX-Format' or in the case of files belonging to the
|
|
133
|
+
`LaTeX-format' a program implementing the `TeX language'.
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
CONDITIONS ON DISTRIBUTION AND MODIFICATION
|
|
138
|
+
===========================================
|
|
139
|
+
|
|
140
|
+
1. Activities other than distribution and/or modification of the Work
|
|
141
|
+
are not covered by this license; they are outside its scope. In
|
|
142
|
+
particular, the act of running the Work is not restricted and no
|
|
143
|
+
requirements are made concerning any offers of support for the Work.
|
|
144
|
+
|
|
145
|
+
2. You may distribute a complete, unmodified copy of the Work as you
|
|
146
|
+
received it. Distribution of only part of the Work is considered
|
|
147
|
+
modification of the Work, and no right to distribute such a Derived
|
|
148
|
+
Work may be assumed under the terms of this clause.
|
|
149
|
+
|
|
150
|
+
3. You may distribute a Compiled Work that has been generated from a
|
|
151
|
+
complete, unmodified copy of the Work as distributed under Clause 2
|
|
152
|
+
above, as long as that Compiled Work is distributed in such a way that
|
|
153
|
+
the recipients may install the Compiled Work on their system exactly
|
|
154
|
+
as it would have been installed if they generated a Compiled Work
|
|
155
|
+
directly from the Work.
|
|
156
|
+
|
|
157
|
+
4. If you are the Current Maintainer of the Work, you may, without
|
|
158
|
+
restriction, modify the Work, thus creating a Derived Work. You may
|
|
159
|
+
also distribute the Derived Work without restriction, including
|
|
160
|
+
Compiled Works generated from the Derived Work. Derived Works
|
|
161
|
+
distributed in this manner by the Current Maintainer are considered to
|
|
162
|
+
be updated versions of the Work.
|
|
163
|
+
|
|
164
|
+
5. If you are not the Current Maintainer of the Work, you may modify
|
|
165
|
+
your copy of the Work, thus creating a Derived Work based on the Work,
|
|
166
|
+
and compile this Derived Work, thus creating a Compiled Work based on
|
|
167
|
+
the Derived Work.
|
|
168
|
+
|
|
169
|
+
6. If you are not the Current Maintainer of the Work, you may
|
|
170
|
+
distribute a Derived Work provided the following conditions are met
|
|
171
|
+
for every component of the Work unless that component clearly states
|
|
172
|
+
in the copyright notice that it is exempt from that condition. Only
|
|
173
|
+
the Current Maintainer is allowed to add such statements of exemption
|
|
174
|
+
to a component of the Work.
|
|
175
|
+
|
|
176
|
+
a. If a component of this Derived Work can be a direct replacement
|
|
177
|
+
for a component of the Work when that component is used with the
|
|
178
|
+
Base Interpreter, then, wherever this component of the Work
|
|
179
|
+
identifies itself to the user when used interactively with that
|
|
180
|
+
Base Interpreter, the replacement component of this Derived Work
|
|
181
|
+
clearly and unambiguously identifies itself as a modified version
|
|
182
|
+
of this component to the user when used interactively with that
|
|
183
|
+
Base Interpreter.
|
|
184
|
+
|
|
185
|
+
b. Every component of the Derived Work contains prominent notices
|
|
186
|
+
detailing the nature of the changes to that component, or a
|
|
187
|
+
prominent reference to another file that is distributed as part
|
|
188
|
+
of the Derived Work and that contains a complete and accurate log
|
|
189
|
+
of the changes.
|
|
190
|
+
|
|
191
|
+
c. No information in the Derived Work implies that any persons,
|
|
192
|
+
including (but not limited to) the authors of the original version
|
|
193
|
+
of the Work, provide any support, including (but not limited to)
|
|
194
|
+
the reporting and handling of errors, to recipients of the
|
|
195
|
+
Derived Work unless those persons have stated explicitly that
|
|
196
|
+
they do provide such support for the Derived Work.
|
|
197
|
+
|
|
198
|
+
d. You distribute at least one of the following with the Derived Work:
|
|
199
|
+
|
|
200
|
+
1. A complete, unmodified copy of the Work;
|
|
201
|
+
if your distribution of a modified component is made by
|
|
202
|
+
offering access to copy the modified component from a
|
|
203
|
+
designated place, then offering equivalent access to copy
|
|
204
|
+
the Work from the same or some similar place meets this
|
|
205
|
+
condition, even though third parties are not compelled to
|
|
206
|
+
copy the Work along with the modified component;
|
|
207
|
+
|
|
208
|
+
2. Information that is sufficient to obtain a complete,
|
|
209
|
+
unmodified copy of the Work.
|
|
210
|
+
|
|
211
|
+
7. If you are not the Current Maintainer of the Work, you may
|
|
212
|
+
distribute a Compiled Work generated from a Derived Work, as long as
|
|
213
|
+
the Derived Work is distributed to all recipients of the Compiled
|
|
214
|
+
Work, and as long as the conditions of Clause 6, above, are met with
|
|
215
|
+
regard to the Derived Work.
|
|
216
|
+
|
|
217
|
+
8. The conditions above are not intended to prohibit, and hence do not
|
|
218
|
+
apply to, the modification, by any method, of any component so that it
|
|
219
|
+
becomes identical to an updated version of that component of the Work as
|
|
220
|
+
it is distributed by the Current Maintainer under Clause 4, above.
|
|
221
|
+
|
|
222
|
+
9. Distribution of the Work or any Derived Work in an alternative
|
|
223
|
+
format, where the Work or that Derived Work (in whole or in part) is
|
|
224
|
+
then produced by applying some process to that format, does not relax or
|
|
225
|
+
nullify any sections of this license as they pertain to the results of
|
|
226
|
+
applying that process.
|
|
227
|
+
|
|
228
|
+
10. a. A Derived Work may be distributed under a different license
|
|
229
|
+
provided that license itself honors the conditions listed in
|
|
230
|
+
Clause 6 above, in regard to the Work, though it does not have
|
|
231
|
+
to honor the rest of the conditions in this license.
|
|
232
|
+
|
|
233
|
+
b. If a Derived Work is distributed under a different license, that
|
|
234
|
+
Derived Work must provide sufficient documentation as part of
|
|
235
|
+
itself to allow each recipient of that Derived Work to honor the
|
|
236
|
+
restrictions in Clause 6 above, concerning changes from the Work.
|
|
237
|
+
|
|
238
|
+
11. This license places no restrictions on works that are unrelated to
|
|
239
|
+
the Work, nor does this license place any restrictions on aggregating
|
|
240
|
+
such works with the Work by any means.
|
|
241
|
+
|
|
242
|
+
12. Nothing in this license is intended to, or may be used to, prevent
|
|
243
|
+
complete compliance by all parties with all applicable laws.
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
NO WARRANTY
|
|
247
|
+
===========
|
|
248
|
+
|
|
249
|
+
There is no warranty for the Work. Except when otherwise stated in
|
|
250
|
+
writing, the Copyright Holder provides the Work `as is', without
|
|
251
|
+
warranty of any kind, either expressed or implied, including, but not
|
|
252
|
+
limited to, the implied warranties of merchantability and fitness for a
|
|
253
|
+
particular purpose. The entire risk as to the quality and performance
|
|
254
|
+
of the Work is with you. Should the Work prove defective, you assume
|
|
255
|
+
the cost of all necessary servicing, repair, or correction.
|
|
256
|
+
|
|
257
|
+
In no event unless required by applicable law or agreed to in writing
|
|
258
|
+
will The Copyright Holder, or any author named in the components of the
|
|
259
|
+
Work, or any other party who may distribute and/or modify the Work as
|
|
260
|
+
permitted above, be liable to you for damages, including any general,
|
|
261
|
+
special, incidental or consequential damages arising out of any use of
|
|
262
|
+
the Work or out of inability to use the Work (including, but not limited
|
|
263
|
+
to, loss of data, data being rendered inaccurate, or losses sustained by
|
|
264
|
+
anyone as a result of any failure of the Work to operate with any other
|
|
265
|
+
programs), even if the Copyright Holder or said author or said other
|
|
266
|
+
party has been advised of the possibility of such damages.
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
MAINTENANCE OF THE WORK
|
|
270
|
+
=======================
|
|
271
|
+
|
|
272
|
+
The Work has the status `author-maintained' if the Copyright Holder
|
|
273
|
+
explicitly and prominently states near the primary copyright notice in
|
|
274
|
+
the Work that the Work can only be maintained by the Copyright Holder
|
|
275
|
+
or simply that it is `author-maintained'.
|
|
276
|
+
|
|
277
|
+
The Work has the status `maintained' if there is a Current Maintainer
|
|
278
|
+
who has indicated in the Work that they are willing to receive error
|
|
279
|
+
reports for the Work (for example, by supplying a valid e-mail
|
|
280
|
+
address). It is not required for the Current Maintainer to acknowledge
|
|
281
|
+
or act upon these error reports.
|
|
282
|
+
|
|
283
|
+
The Work changes from status `maintained' to `unmaintained' if there
|
|
284
|
+
is no Current Maintainer, or the person stated to be Current
|
|
285
|
+
Maintainer of the work cannot be reached through the indicated means
|
|
286
|
+
of communication for a period of six months, and there are no other
|
|
287
|
+
significant signs of active maintenance.
|
|
288
|
+
|
|
289
|
+
You can become the Current Maintainer of the Work by agreement with
|
|
290
|
+
any existing Current Maintainer to take over this role.
|
|
291
|
+
|
|
292
|
+
If the Work is unmaintained, you can become the Current Maintainer of
|
|
293
|
+
the Work through the following steps:
|
|
294
|
+
|
|
295
|
+
1. Make a reasonable attempt to trace the Current Maintainer (and
|
|
296
|
+
the Copyright Holder, if the two differ) through the means of
|
|
297
|
+
an Internet or similar search.
|
|
298
|
+
|
|
299
|
+
2. If this search is successful, then enquire whether the Work
|
|
300
|
+
is still maintained.
|
|
301
|
+
|
|
302
|
+
a. If it is being maintained, then ask the Current Maintainer
|
|
303
|
+
to update their communication data within one month.
|
|
304
|
+
|
|
305
|
+
b. If the search is unsuccessful or no action to resume active
|
|
306
|
+
maintenance is taken by the Current Maintainer, then announce
|
|
307
|
+
within the pertinent community your intention to take over
|
|
308
|
+
maintenance. (If the Work is a LaTeX work, this could be
|
|
309
|
+
done, for example, by posting to comp.text.tex.)
|
|
310
|
+
|
|
311
|
+
3a. If the Current Maintainer is reachable and agrees to pass
|
|
312
|
+
maintenance of the Work to you, then this takes effect
|
|
313
|
+
immediately upon announcement.
|
|
314
|
+
|
|
315
|
+
b. If the Current Maintainer is not reachable and the Copyright
|
|
316
|
+
Holder agrees that maintenance of the Work be passed to you,
|
|
317
|
+
then this takes effect immediately upon announcement.
|
|
318
|
+
|
|
319
|
+
4. If you make an `intention announcement' as described in 2b. above
|
|
320
|
+
and after three months your intention is challenged neither by
|
|
321
|
+
the Current Maintainer nor by the Copyright Holder nor by other
|
|
322
|
+
people, then you may arrange for the Work to be changed so as
|
|
323
|
+
to name you as the (new) Current Maintainer.
|
|
324
|
+
|
|
325
|
+
5. If the previously unreachable Current Maintainer becomes
|
|
326
|
+
reachable once more within three months of a change completed
|
|
327
|
+
under the terms of 3b) or 4), then that Current Maintainer must
|
|
328
|
+
become or remain the Current Maintainer upon request provided
|
|
329
|
+
they then update their communication data within one month.
|
|
330
|
+
|
|
331
|
+
A change in the Current Maintainer does not, of itself, alter the fact
|
|
332
|
+
that the Work is distributed under the LPPL license.
|
|
333
|
+
|
|
334
|
+
If you become the Current Maintainer of the Work, you should
|
|
335
|
+
immediately provide, within the Work, a prominent and unambiguous
|
|
336
|
+
statement of your status as Current Maintainer. You should also
|
|
337
|
+
announce your new status to the same pertinent community as
|
|
338
|
+
in 2b) above.
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE
|
|
342
|
+
======================================================
|
|
343
|
+
|
|
344
|
+
This section contains important instructions, examples, and
|
|
345
|
+
recommendations for authors who are considering distributing their
|
|
346
|
+
works under this license. These authors are addressed as `you' in
|
|
347
|
+
this section.
|
|
348
|
+
|
|
349
|
+
Choosing This License or Another License
|
|
350
|
+
----------------------------------------
|
|
351
|
+
|
|
352
|
+
If for any part of your work you want or need to use *distribution*
|
|
353
|
+
conditions that differ significantly from those in this license, then
|
|
354
|
+
do not refer to this license anywhere in your work but, instead,
|
|
355
|
+
distribute your work under a different license. You may use the text
|
|
356
|
+
of this license as a model for your own license, but your license
|
|
357
|
+
should not refer to the LPPL or otherwise give the impression that
|
|
358
|
+
your work is distributed under the LPPL.
|
|
359
|
+
|
|
360
|
+
The document `modguide.tex' in the base LaTeX distribution explains
|
|
361
|
+
the motivation behind the conditions of this license. It explains,
|
|
362
|
+
for example, why distributing LaTeX under the GNU General Public
|
|
363
|
+
License (GPL) was considered inappropriate. Even if your work is
|
|
364
|
+
unrelated to LaTeX, the discussion in `modguide.tex' may still be
|
|
365
|
+
relevant, and authors intending to distribute their works under any
|
|
366
|
+
license are encouraged to read it.
|
|
367
|
+
|
|
368
|
+
A Recommendation on Modification Without Distribution
|
|
369
|
+
-----------------------------------------------------
|
|
370
|
+
|
|
371
|
+
It is wise never to modify a component of the Work, even for your own
|
|
372
|
+
personal use, without also meeting the above conditions for
|
|
373
|
+
distributing the modified component. While you might intend that such
|
|
374
|
+
modifications will never be distributed, often this will happen by
|
|
375
|
+
accident -- you may forget that you have modified that component; or
|
|
376
|
+
it may not occur to you when allowing others to access the modified
|
|
377
|
+
version that you are thus distributing it and violating the conditions
|
|
378
|
+
of this license in ways that could have legal implications and, worse,
|
|
379
|
+
cause problems for the community. It is therefore usually in your
|
|
380
|
+
best interest to keep your copy of the Work identical with the public
|
|
381
|
+
one. Many works provide ways to control the behavior of that work
|
|
382
|
+
without altering any of its licensed components.
|
|
383
|
+
|
|
384
|
+
How to Use This License
|
|
385
|
+
-----------------------
|
|
386
|
+
|
|
387
|
+
To use this license, place in each of the components of your work both
|
|
388
|
+
an explicit copyright notice including your name and the year the work
|
|
389
|
+
was authored and/or last substantially modified. Include also a
|
|
390
|
+
statement that the distribution and/or modification of that
|
|
391
|
+
component is constrained by the conditions in this license.
|
|
392
|
+
|
|
393
|
+
Here is an example of such a notice and statement:
|
|
394
|
+
|
|
395
|
+
%% pig.dtx
|
|
396
|
+
%% Copyright 2008 M. Y. Name
|
|
397
|
+
%
|
|
398
|
+
% This work may be distributed and/or modified under the
|
|
399
|
+
% conditions of the LaTeX Project Public License, either version 1.3
|
|
400
|
+
% of this license or (at your option) any later version.
|
|
401
|
+
% The latest version of this license is in
|
|
402
|
+
% https://www.latex-project.org/lppl.txt
|
|
403
|
+
% and version 1.3c or later is part of all distributions of LaTeX
|
|
404
|
+
% version 2008 or later.
|
|
405
|
+
%
|
|
406
|
+
% This work has the LPPL maintenance status `maintained'.
|
|
407
|
+
%
|
|
408
|
+
% The Current Maintainer of this work is M. Y. Name.
|
|
409
|
+
%
|
|
410
|
+
% This work consists of the files pig.dtx and pig.ins
|
|
411
|
+
% and the derived file pig.sty.
|
|
412
|
+
|
|
413
|
+
Given such a notice and statement in a file, the conditions
|
|
414
|
+
given in this license document would apply, with the `Work' referring
|
|
415
|
+
to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being
|
|
416
|
+
generated from `pig.dtx' using `pig.ins'), the `Base Interpreter'
|
|
417
|
+
referring to any `LaTeX-Format', and both `Copyright Holder' and
|
|
418
|
+
`Current Maintainer' referring to the person `M. Y. Name'.
|
|
419
|
+
|
|
420
|
+
If you do not want the Maintenance section of LPPL to apply to your
|
|
421
|
+
Work, change `maintained' above into `author-maintained'.
|
|
422
|
+
However, we recommend that you use `maintained', as the Maintenance
|
|
423
|
+
section was added in order to ensure that your Work remains useful to
|
|
424
|
+
the community even when you can no longer maintain and support it
|
|
425
|
+
yourself.
|
|
426
|
+
|
|
427
|
+
Derived Works That Are Not Replacements
|
|
428
|
+
---------------------------------------
|
|
429
|
+
|
|
430
|
+
Several clauses of the LPPL specify means to provide reliability and
|
|
431
|
+
stability for the user community. They therefore concern themselves
|
|
432
|
+
with the case that a Derived Work is intended to be used as a
|
|
433
|
+
(compatible or incompatible) replacement of the original Work. If
|
|
434
|
+
this is not the case (e.g., if a few lines of code are reused for a
|
|
435
|
+
completely different task), then clauses 6b and 6d shall not apply.
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
Important Recommendations
|
|
439
|
+
-------------------------
|
|
440
|
+
|
|
441
|
+
Defining What Constitutes the Work
|
|
442
|
+
|
|
443
|
+
The LPPL requires that distributions of the Work contain all the
|
|
444
|
+
files of the Work. It is therefore important that you provide a
|
|
445
|
+
way for the licensee to determine which files constitute the Work.
|
|
446
|
+
This could, for example, be achieved by explicitly listing all the
|
|
447
|
+
files of the Work near the copyright notice of each file or by
|
|
448
|
+
using a line such as:
|
|
449
|
+
|
|
450
|
+
% This work consists of all files listed in manifest.txt.
|
|
451
|
+
|
|
452
|
+
in that place. In the absence of an unequivocal list it might be
|
|
453
|
+
impossible for the licensee to determine what is considered by you
|
|
454
|
+
to comprise the Work and, in such a case, the licensee would be
|
|
455
|
+
entitled to make reasonable conjectures as to which files comprise
|
|
456
|
+
the Work.
|
|
457
|
+
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# Math font data
|
|
2
|
+
|
|
3
|
+
`font.js` contains SVG outlines and OpenType MATH data from **Latin Modern Math 1.959**. The parser,
|
|
4
|
+
layout engine, contour analysis and decoder are Rapier code. The converted font data remains under the
|
|
5
|
+
GUST Font License.
|
|
6
|
+
|
|
7
|
+
## Sources and licenses
|
|
8
|
+
|
|
9
|
+
| Input | SHA-256 |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| Latin Modern Math 1.959, `latinmodern-math.otf` | `6075562b771f8b82f0c179e363389684f2dd09de30038269e2628e504bd7be0f` |
|
|
12
|
+
| Original GUST Font License | `2bd69affc3da00715116f713f57eab9707e96daf3562ad0215987b15b9c16f73` |
|
|
13
|
+
| LPPL 1.3c | `3d262cdf34dafa6955f703c634a8c238ec44109bc8dd6ef34fb7aa54809f7e66` |
|
|
14
|
+
| Combined `FONT-LICENSE.txt` | `91ded9a2a371cbeff028bfaf3bd3e97fddfb68af6f186aa261bfaff35baf800c` |
|
|
15
|
+
| Geist 1.800, weight axis 400–700 | `6e3a140e3812161e292fbe42a1fc90533b2407b699c65abc7a098b0979df4e82` |
|
|
16
|
+
|
|
17
|
+
The [complete original font package](https://mirrors.ctan.org/fonts/lm-math.zip) is available from CTAN.
|
|
18
|
+
The generator's font and GUST license URLs are under
|
|
19
|
+
<https://mirror.apps.cam.ac.uk/pub/tex-archive/fonts/lm-math/>. LPPL 1.3c comes from
|
|
20
|
+
<https://www.latex-project.org/lppl/lppl-1-3c.txt>. Each download is checked against its content hash.
|
|
21
|
+
|
|
22
|
+
`FONT-LICENSE.txt` starts with the font's exact copyright, followed by the conversion notice and the complete,
|
|
23
|
+
unmodified GUST Font License and LPPL 1.3c. The same bytes are retained in the `/*! ... */` header of `font.js`,
|
|
24
|
+
the plug-in and its license sheet. Preserve this notice when packaging. The conversion has a different filename
|
|
25
|
+
and identifies its changes; the original font authors do not maintain it. Rapier's separate typesetter is MIT.
|
|
26
|
+
|
|
27
|
+
The calibration font is the editor's exact Geist file, from the pinned public source at
|
|
28
|
+
<https://raw.githubusercontent.com/jackskip22/rapier/326a7387a190b011543fae5f5f2c6144f6163b3d/src/shell/fonts/Geist.wght400-700.woff2>.
|
|
29
|
+
Only its numeric height measurements enter the math asset. Geist outlines are not included in the math plug-in.
|
|
30
|
+
|
|
31
|
+
## Rebuild
|
|
32
|
+
|
|
33
|
+
The generated asset uses Python 3.12, fontTools 4.61.1, Brotli 1.1.0 and zlib 1.3.2:
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
python -m pip install fonttools==4.61.1 Brotli==1.1.0
|
|
37
|
+
python repo/math/build-font.py
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
In the standalone package, run `python src/math/build-font.py`. To regenerate without network access, supply the
|
|
41
|
+
exact inputs with `--font`, `--license`, `--lppl` and `--text-font`. `--out` selects the JavaScript path and writes
|
|
42
|
+
the combined license beside it. When available, the generator uses the editor's local Geist font.
|
|
43
|
+
|
|
44
|
+
The generator preserves all **2,045 Unicode mappings** in the font and **4,741 glyphs** reachable from those
|
|
45
|
+
mappings. The glyph set is closed over stretch variants, assembly parts, first- and second-level optical script
|
|
46
|
+
forms (`ssty`), flattened accents (`flac`) and dotless bases (`dtls`). This font supplies 980 script records,
|
|
47
|
+
48 dotless substitutions, 94 vertical constructions, 86 horizontal constructions and no flattened alternates.
|
|
48
|
+
Every included outline and mathematical metric retains its original values. Optional text shaping and stylistic
|
|
49
|
+
substitutions that the math syntax does not select are not included.
|
|
50
|
+
|
|
51
|
+
The exact-outline claim applies to this font asset. Separately, the typesetter's `fallbacks.js` composes 29
|
|
52
|
+
additional Unicode symbols from Latin Modern outlines, outline parts and rules, restoring 31 named command
|
|
53
|
+
aliases in the existing vocabulary. These include digamma, filled and turned symbols, compound relations,
|
|
54
|
+
dashed arrows, the sum-integral and moustache delimiters. No other font contributes geometry.
|
|
55
|
+
|
|
56
|
+
Latin Modern Math has uppercase script and bold-script alphabets but no lowercase glyphs in either style.
|
|
57
|
+
The typesetter retains its existing ordinary-letter fallback for those lowercase requests; it cannot supply
|
|
58
|
+
the absent calligraphic forms. Its unencoded glyphs contain no alternative lowercase script alphabet.
|
|
59
|
+
|
|
60
|
+
Different zlib versions can encode the same exact data differently. The package budget is measured with
|
|
61
|
+
Node 22.23.3 by `tools/build-math.mjs`; the packed stream always decodes to the original coordinates and metrics.
|
|
62
|
+
|
|
63
|
+
## Height and optical forms
|
|
64
|
+
|
|
65
|
+
Both fonts use 1,000 units per em. Their `OS/2.sxHeight` values are **431** for Latin Modern Math and **530** for
|
|
66
|
+
Geist. The regular upright `x` outlines confirm these values: their vertical bounds are 0–431 and 0–530.
|
|
67
|
+
Math therefore scales by **530/431**, approximately **1.2296983758700697**, relative to surrounding text.
|
|
68
|
+
The font's italic `x` retains its designed overshoot, with bounds −11–442.
|
|
69
|
+
|
|
70
|
+
Geist's nominal height remains 530 across its weight axis. Its drawn `x` reaches 532 at weight 500, 535 at 650,
|
|
71
|
+
and 536 at 700; the normalization uses the nominal height. It applies continuously at every text size.
|
|
72
|
+
Latin Modern supplies 70% and 50% optical script scales. Screen layout can enlarge scripts while retaining the
|
|
73
|
+
appropriate `ssty` outlines. The source's fraction and radical rule thicknesses are 40 units.
|
|
74
|
+
|
|
75
|
+
## Runtime schema
|
|
76
|
+
|
|
77
|
+
The asset initializes `MATH_FONT`. Paths use upward-positive font coordinates; SVG rendering reverses the
|
|
78
|
+
vertical axis. Measurements are in design units unless specified otherwise.
|
|
79
|
+
|
|
80
|
+
| Field | Value |
|
|
81
|
+
| --- | --- |
|
|
82
|
+
| `units`, `xHeight` | Math units per em and nominal x-height. |
|
|
83
|
+
| `textUnits`, `textXHeight` | Geist units per em and nominal x-height. |
|
|
84
|
+
| `chars` | Decimal Unicode code point to glyph index. |
|
|
85
|
+
| `glyph(id)` | Demand-decoded `[advance, xMin, yMin, xMax, yMax, italicCorrection, topAccent, path]`. Missing IDs return `undefined`. |
|
|
86
|
+
| `constants` | All 56 original OpenType `MathConstants`; percentage constants remain percentages. |
|
|
87
|
+
| `vertical`, `horizontal` | Glyph index to `{variants, assembly?}`. |
|
|
88
|
+
| `variants` | `[glyphIndex, advanceMeasurement]` pairs in font order. |
|
|
89
|
+
| `assembly` | `{italic, parts}`. |
|
|
90
|
+
| `parts` | `[glyphIndex, startConnector, endConnector, fullAdvance, isExtender]`. |
|
|
91
|
+
| `minConnectorOverlap` | The font's minimum assembly overlap. |
|
|
92
|
+
| `kern` | Four corner records per glyph, if present in the source; empty for Latin Modern. |
|
|
93
|
+
| `scriptAlternates` | First- and second-level `ssty` glyph indices. |
|
|
94
|
+
| `flatAccents`, `dotless` | Alternate glyph indices for `flac` and `dtls`. |
|
|
95
|
+
| `extendedShapes` | Glyphs marked by `MathGlyphInfo.ExtendedShapeCoverage`. |
|
|
96
|
+
| `edgeStep` | Height of each contour strip: 32 design units. |
|
|
97
|
+
| `profile(id)` | Demand-decoded `[y0, [xMin, xMax], null, ...]` for a glyph, or `undefined` when absent; each following entry describes one strip. |
|
|
98
|
+
|
|
99
|
+
Outline bounds round outward to whole units. The outlines themselves are unchanged, including exact fractional
|
|
100
|
+
coordinates if present. Missing italic corrections are zero; missing accent attachments use half the advance.
|
|
101
|
+
Assembly parts retain the OpenType order: bottom to top vertically, left to right horizontally. Latin Modern has
|
|
102
|
+
no MATH Device adjustments. Hint programs and general text shaping tables are not used by the SVG renderer.
|
|
103
|
+
|
|
104
|
+
Contour profiles cover 1,187 ASCII alphanumeric, mathematical italic and script glyphs, including optical and
|
|
105
|
+
dotless forms. Entry `i + 1` bounds the original contour within `[y0 + i * edgeStep, y0 + (i + 1) * edgeStep]`;
|
|
106
|
+
`null` means no ink. Cubic intersections and horizontal extrema determine the bounds. Values round outward
|
|
107
|
+
with a small numerical guard. Profiles are derived spacing data; they do not replace outlines or pretend to be
|
|
108
|
+
an original MATH kern table. Layout compares intersecting strips from both glyphs when placing scripts.
|
|
109
|
+
|
|
110
|
+
Character mappings, optical substitutions and record offsets occupy a compact index decoded at module load.
|
|
111
|
+
Glyph metrics, outlines and contour profiles stay in independent raw DEFLATE pages until requested. Every page
|
|
112
|
+
ends at a record boundary and contains at most 16,384 decoded bytes. The complete set of pages travels in the
|
|
113
|
+
same asset; rare characters, stretch parts and optical forms require no additional download.
|
|
114
|
+
|
|
115
|
+
Outlines share exactly matching contours after translation. The 8,115 ordered contour references use 4,970
|
|
116
|
+
unique contour records. A record either stores its original command structure and relative coordinates, or
|
|
117
|
+
exact differences from an earlier contour with the same structure. Parent chains have at most four links.
|
|
118
|
+
The generator prefers small coordinate differences as well as short records, because the smallest initial
|
|
119
|
+
record does not necessarily produce the smallest compressed page. Glyph assembly restores the original
|
|
120
|
+
absolute `M/L/H/V/C/Z` paths, including contour order; existing outline-part consumers use those commands.
|
|
121
|
+
|
|
122
|
+
Glyph metrics use reversible bearing and half-advance predictors with a median origin per metric field.
|
|
123
|
+
They retain the complete original bounds, advance, italic and accent measurements. Signed record integers
|
|
124
|
+
use zigzag values: values below 240 take one byte, the next 3,840 values take two bytes, and larger values use
|
|
125
|
+
an escape followed by unsigned LEB128. The coordinate unit is exact; this encoding performs no quantization.
|
|
126
|
+
|
|
127
|
+
Profiles retain the original left/right strip coordinates and exact differences from matching strip structures.
|
|
128
|
+
Identical arrays share storage: all 1,187 glyph-to-profile mappings are represented by 1,080 unique records.
|
|
129
|
+
The renderer only asks for profiles when side-script placement can use them.
|
|
130
|
+
|
|
131
|
+
The font owns three bounded least-recently-used caches: eight inflated pages, 256 completed glyph records and
|
|
132
|
+
128 contour profiles. Temporary parent coordinates and page views are discarded after a glyph is assembled;
|
|
133
|
+
cached glyphs contain the completed path and metrics. Reusing an evicted record reconstructs the same data.
|
|
134
|
+
These caches contain font data only. They retain no formula source, parse tree, layout result, SVG element or
|
|
135
|
+
document. Returned internal records are read-only to consumers.
|
|
136
|
+
|
|
137
|
+
The synchronous decoder checks compressed input, output size, record boundaries and parent depth. It requires
|
|
138
|
+
no network, font installation, font parser or platform font shaping at runtime. `glyph` and `profile` are
|
|
139
|
+
internal font accessors; the public parser and rendering API remain independent of this storage format.
|
|
140
|
+
|
|
141
|
+
The format follows the [OpenType MATH specification](https://learn.microsoft.com/en-us/typography/opentype/spec/math)
|
|
142
|
+
and [RFC 1951](https://www.rfc-editor.org/rfc/rfc1951). Three retained constants have no active consumer:
|
|
143
|
+
`DelimitedSubFormulaMinHeight`, `SkewedFractionHorizontalGap` and `SkewedFractionVerticalGap`.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jack Skipworth
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|