katex 0.12.0 → 0.13.3

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.
Files changed (167) hide show
  1. package/CHANGELOG.md +112 -0
  2. package/LICENSE +1 -1
  3. package/README.md +8 -7
  4. package/contrib/auto-render/auto-render.js +12 -19
  5. package/contrib/auto-render/index.html +9 -3
  6. package/contrib/auto-render/splitAtDelimiters.js +44 -61
  7. package/contrib/auto-render/test/auto-render-spec.js +88 -52
  8. package/contrib/copy-tex/README.md +5 -9
  9. package/contrib/copy-tex/copy-tex.css +0 -3
  10. package/contrib/mathtex-script-type/README.md +5 -5
  11. package/contrib/mhchem/README.md +4 -2
  12. package/contrib/render-a11y-string/render-a11y-string.js +31 -2
  13. package/contrib/render-a11y-string/test/render-a11y-string-spec.js +23 -0
  14. package/dist/README.md +8 -7
  15. package/dist/contrib/auto-render.js +148 -171
  16. package/dist/contrib/auto-render.min.js +1 -1
  17. package/dist/contrib/auto-render.mjs +91 -95
  18. package/dist/contrib/copy-tex.css +3 -3
  19. package/dist/contrib/copy-tex.js +11 -108
  20. package/dist/contrib/copy-tex.min.css +1 -1
  21. package/dist/contrib/copy-tex.min.js +1 -1
  22. package/dist/contrib/copy-tex.mjs +21 -20
  23. package/dist/contrib/mathtex-script-type.js +66 -91
  24. package/dist/contrib/mathtex-script-type.min.js +1 -1
  25. package/dist/contrib/mathtex-script-type.mjs +3 -3
  26. package/dist/contrib/mhchem.js +70 -95
  27. package/dist/contrib/mhchem.min.js +1 -1
  28. package/dist/contrib/mhchem.mjs +2 -2
  29. package/dist/contrib/render-a11y-string.js +97 -92
  30. package/dist/contrib/render-a11y-string.min.js +1 -1
  31. package/dist/contrib/render-a11y-string.mjs +86 -45
  32. package/dist/fonts/KaTeX_AMS-Regular.ttf +0 -0
  33. package/dist/fonts/KaTeX_AMS-Regular.woff +0 -0
  34. package/dist/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  35. package/dist/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
  36. package/dist/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
  37. package/dist/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  38. package/dist/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
  39. package/dist/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
  40. package/dist/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  41. package/dist/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
  42. package/dist/fonts/KaTeX_Fraktur-Bold.woff +0 -0
  43. package/dist/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  44. package/dist/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
  45. package/dist/fonts/KaTeX_Fraktur-Regular.woff +0 -0
  46. package/dist/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  47. package/dist/fonts/KaTeX_Main-Bold.ttf +0 -0
  48. package/dist/fonts/KaTeX_Main-Bold.woff +0 -0
  49. package/dist/fonts/KaTeX_Main-Bold.woff2 +0 -0
  50. package/dist/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
  51. package/dist/fonts/KaTeX_Main-BoldItalic.woff +0 -0
  52. package/dist/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  53. package/dist/fonts/KaTeX_Main-Italic.ttf +0 -0
  54. package/dist/fonts/KaTeX_Main-Italic.woff +0 -0
  55. package/dist/fonts/KaTeX_Main-Italic.woff2 +0 -0
  56. package/dist/fonts/KaTeX_Main-Regular.ttf +0 -0
  57. package/dist/fonts/KaTeX_Main-Regular.woff +0 -0
  58. package/dist/fonts/KaTeX_Main-Regular.woff2 +0 -0
  59. package/dist/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
  60. package/dist/fonts/KaTeX_Math-BoldItalic.woff +0 -0
  61. package/dist/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  62. package/dist/fonts/KaTeX_Math-Italic.ttf +0 -0
  63. package/dist/fonts/KaTeX_Math-Italic.woff +0 -0
  64. package/dist/fonts/KaTeX_Math-Italic.woff2 +0 -0
  65. package/dist/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
  66. package/dist/fonts/KaTeX_SansSerif-Bold.woff +0 -0
  67. package/dist/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  68. package/dist/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
  69. package/dist/fonts/KaTeX_SansSerif-Italic.woff +0 -0
  70. package/dist/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  71. package/dist/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
  72. package/dist/fonts/KaTeX_SansSerif-Regular.woff +0 -0
  73. package/dist/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  74. package/dist/fonts/KaTeX_Script-Regular.ttf +0 -0
  75. package/dist/fonts/KaTeX_Script-Regular.woff +0 -0
  76. package/dist/fonts/KaTeX_Script-Regular.woff2 +0 -0
  77. package/dist/fonts/KaTeX_Size1-Regular.ttf +0 -0
  78. package/dist/fonts/KaTeX_Size1-Regular.woff +0 -0
  79. package/dist/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  80. package/dist/fonts/KaTeX_Size2-Regular.ttf +0 -0
  81. package/dist/fonts/KaTeX_Size2-Regular.woff +0 -0
  82. package/dist/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  83. package/dist/fonts/KaTeX_Size3-Regular.ttf +0 -0
  84. package/dist/fonts/KaTeX_Size3-Regular.woff +0 -0
  85. package/dist/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  86. package/dist/fonts/KaTeX_Size4-Regular.ttf +0 -0
  87. package/dist/fonts/KaTeX_Size4-Regular.woff +0 -0
  88. package/dist/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  89. package/dist/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
  90. package/dist/fonts/KaTeX_Typewriter-Regular.woff +0 -0
  91. package/dist/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  92. package/dist/katex.css +66 -10
  93. package/dist/katex.js +2714 -1950
  94. package/dist/katex.min.css +1 -1
  95. package/dist/katex.min.js +1 -1
  96. package/dist/katex.mjs +3162 -2372
  97. package/katex.js +4 -3
  98. package/package.json +69 -59
  99. package/src/Lexer.js +4 -2
  100. package/src/MacroExpander.js +117 -37
  101. package/src/Options.js +2 -2
  102. package/src/ParseError.js +1 -1
  103. package/src/Parser.js +100 -159
  104. package/src/Settings.js +2 -2
  105. package/src/Style.js +4 -4
  106. package/src/Token.js +1 -1
  107. package/src/buildCommon.js +12 -5
  108. package/src/buildHTML.js +11 -0
  109. package/src/buildMathML.js +6 -0
  110. package/src/defineEnvironment.js +0 -3
  111. package/src/defineFunction.js +15 -22
  112. package/src/delimiter.js +61 -57
  113. package/src/domTree.js +1 -1
  114. package/src/environments/array.js +223 -35
  115. package/src/environments/cd.js +312 -0
  116. package/src/fontMetrics.js +1 -1
  117. package/src/fontMetricsData.js +2076 -0
  118. package/src/fonts/.gitignore +9 -0
  119. package/src/fonts/Makefile +139 -0
  120. package/src/fonts/default.cfg +20 -0
  121. package/src/fonts/generate_fonts.py +61 -0
  122. package/src/fonts/lib/Extra.otf +0 -0
  123. package/src/fonts/lib/Space.ttx +234 -0
  124. package/src/fonts/makeBlacker +49 -0
  125. package/src/fonts/makeFF +2003 -0
  126. package/src/fonts/xbbold.mf +182 -0
  127. package/src/fonts.less +64 -0
  128. package/src/functions/accent.js +3 -2
  129. package/src/functions/arrow.js +8 -2
  130. package/src/functions/color.js +4 -4
  131. package/src/functions/cr.js +7 -25
  132. package/src/functions/def.js +50 -24
  133. package/src/functions/delimsizing.js +8 -0
  134. package/src/functions/enclose.js +80 -12
  135. package/src/functions/environment.js +1 -1
  136. package/src/functions/font.js +3 -4
  137. package/src/functions/genfrac.js +36 -11
  138. package/src/functions/hbox.js +39 -0
  139. package/src/functions/kern.js +1 -0
  140. package/src/functions/mathchoice.js +1 -0
  141. package/src/functions/mclass.js +2 -1
  142. package/src/functions/op.js +3 -7
  143. package/src/functions/operatorname.js +1 -1
  144. package/src/functions/raisebox.js +0 -1
  145. package/src/functions/styling.js +1 -0
  146. package/src/functions/supsub.js +1 -3
  147. package/src/functions/symbolsOrd.js +0 -2
  148. package/src/functions/text.js +2 -3
  149. package/src/functions/vcenter.js +44 -0
  150. package/src/functions.js +3 -0
  151. package/src/katex.less +69 -16
  152. package/src/macros.js +42 -6
  153. package/src/mathMLTree.js +16 -1
  154. package/src/metrics/.gitignore +1 -0
  155. package/src/metrics/README.md +23 -0
  156. package/src/metrics/extract_tfms.py +114 -0
  157. package/src/metrics/extract_ttfs.py +119 -0
  158. package/src/metrics/format_json.py +28 -0
  159. package/src/metrics/mapping.pl +1224 -0
  160. package/src/metrics/parse_tfm.py +211 -0
  161. package/src/parseNode.js +29 -1
  162. package/src/parseTree.js +6 -0
  163. package/src/stretchy.js +12 -5
  164. package/src/svgGeometry.js +33 -4
  165. package/src/symbols.js +5 -3
  166. package/src/types.js +3 -2
  167. package/src/unicodeScripts.js +5 -0
@@ -0,0 +1,2003 @@
1
+ #! /usr/bin/perl
2
+
3
+ # Creates the FontForge files needed to create the
4
+ # KaTeX fonts from the TeX source files, constructing some
5
+ # glyphs from two or more parts, when needed.
6
+ #
7
+ # Usage: ./makeFF
8
+
9
+ require "custom.cfg.pl";
10
+
11
+ #########################################################################
12
+
13
+ $map{cmr10} = {
14
+ "Main-Regular" => [
15
+ [0,1] => 0x393, # \Gamma, \Delta
16
+ 2 => 0x398, # \Theta
17
+ 3 => 0x39B, # \Lambda
18
+ 4 => 0x39E, # \Xi
19
+ 5 => 0x3A0, # \Pi
20
+ 6 => 0x3A3, # \Sigma
21
+ [7,8] => 0x3A5, # \Upsilon, \Phi
22
+ [9,0xA] => 0x3A8, # \Psi, \Omega
23
+
24
+ 0x10 => 0x131, # \i
25
+ 0x11 => 0x237, # \j
26
+ 0x12 => 0x2CB, # \grave
27
+ 0x13 => 0x2CA, # \acute
28
+ 0x14 => 0x2C7, # \check
29
+ 0x15 => 0x2D8, # \breve
30
+ 0x16 => 0x2C9, # \bar
31
+ 0x17 => [0xB0,-125,0], # \degree
32
+ 0x17 => 0x02DA, # \r, ring above
33
+ 0x18 => 0xB8, # \c, cedilla
34
+
35
+ [0x21,0x2F] => 0x21, # !, ", #, $, %, &, ', (, ), *, +, comma, -, ., /
36
+ 0x22 => 0x201D, # "
37
+ 0x27 => 0x2019, # '
38
+ [0x30,0x39] => 0x30, # 0-9
39
+ [0x3A,0x3B] => 0x3A, # :, ;
40
+ 0x3D => 0x3D, # =
41
+ [0x3F,0x40] => 0x3F, # ?, @
42
+ [0x41,0x5A] => 0x41, # A-Z
43
+ 0x5B => 0x5B, # [
44
+ 0x5C => 0x201C, # ``
45
+ [0x5D,0x5E] => 0x5D, # ], ^
46
+ 0x5E => 0x2C6, # \hat
47
+ 0x5F => 0x2D9, # \dot
48
+ 0x60 => 0x2018, # `
49
+ [0x61,0x7A] => 0x61, # a-z
50
+ [0x7B,0x7C] => 0x2013, # \endash, \emdash
51
+ 0x7B => [0x5F,0,-310], # underline
52
+ 0x7D => 0x2DD, # double acute
53
+ 0x7E => [0x7E,0,-350], # ~
54
+ 0x7E => 0x2DC, # \tilde
55
+ 0x7F => 0xA8, # \ddot
56
+ 0x19 => 0xDF, # sharp S
57
+ 0x1A => 0xE6, # ae ligature
58
+ 0x1B => 0x153, # oe ligature
59
+ 0x1C => 0xF8, # o with slash
60
+ 0x1D => 0xC6, # AE ligature
61
+ 0x1E => 0x152, # OE ligature
62
+ 0x1F => 0xD8, # O with slash
63
+ ],
64
+ };
65
+
66
+ $map{cmmi10} = {
67
+ "Math-Italic" => [
68
+ [0,1] => 0x393, # \Gamma, \Delta
69
+ 2 => 0x398, # \Theta
70
+ 3 => 0x39B, # \Lambda
71
+ 4 => 0x39E, # \Xi
72
+ 5 => 0x3A0, # \Pi
73
+ 6 => 0x3A3, # \Sigma
74
+ [7,8] => 0x3A5, # \Upsilon, \Phi
75
+ [9,0xA] => 0x3A8, # \Psi, \Omega
76
+
77
+ [0xB,0xE] => 0x3B1, # \alpha, \beta, \gamma, \delta
78
+ 0xF => 0x3F5, # \elpsilon
79
+ [0x10,0x18] => 0x3B6, # \zeta, \eta, \theta, \iota, \kappa, \lambda, \mu, \nu, \xi
80
+ [0x19,0x1A] => 0x3C0, # \pi, \rho
81
+ [0x1B,0x1D] => 0x3C3, # \sigma, \tau, \upsilon
82
+ 0x1E => 0x3D5, # \phi
83
+ [0x1F,0x21] => 0x3C7, # \chi, \psi, \omega
84
+ 0x22 => 0x3B5, # \varepsilon
85
+ 0x23 => 0x3D1, # \vartheta
86
+ 0x24 => 0x3D6, # \varpi
87
+ 0x25 => 0x3F1, # \varrho
88
+ 0x26 => 0x3C2, # \varsigma
89
+ 0x27 => 0x3C6, # \varphi
90
+
91
+ [0x41,0x5A] => 0x41, # A-Z
92
+ [0x61,0x7A] => 0x61, # a - z
93
+ [0x30,0x39] => 0x30, # Oldstyle 0-9
94
+
95
+ 0x6F => 0x3BF, # omicron
96
+ 0x7B => 0xE131, # \imath (These differ from \i and \j, so use PUA character)
97
+ 0x7C => 0xE237, # \jmath
98
+ ],
99
+
100
+ "Main-Regular" => [
101
+ 0x28 => 0x21BC, # \leftharpoonup
102
+ 0x29 => 0x21BD, # \leftharpoondown
103
+ 0x2A => 0x21C0, # \rightharpoonup
104
+ 0x2B => 0x21C1, # \rightharpoondown
105
+
106
+ 0x2E => 0x25B9, # \triangleright
107
+ 0x2F => 0x25C3, # \triangleleft
108
+
109
+ 0x3A => 0x2E, # .
110
+ 0x3B => 0x2C, # ,
111
+ 0x3C => 0x3C, # <
112
+ 0x3D => 0x2215, # /
113
+ 0x3E => 0x3E, # >
114
+ 0x3F => 0x22C6, # \star
115
+ 0x40 => 0x2202, # \partial
116
+
117
+ [0x5B,0x5D] => 0x266D, # \flat, \natural, \sharp
118
+ 0x5E => 0x2323, # \smile
119
+ 0x5F => 0x2322, # \frown
120
+ 0x60 => 0x2113, # \ell
121
+
122
+ 0x7D => 0x2118, # \wp
123
+ 0x7E => [0x20D7,-653,0],# \vec
124
+ ],
125
+ };
126
+
127
+ $map{cmsy10} = {
128
+ "Main-Regular" => [
129
+ [0,1] => 0x2212, # -
130
+ 1 => 0x22C5, # \cdot
131
+ 2 => 0xD7, # \times
132
+ 3 => 0x2217, # \ast
133
+ 4 => 0xF7, # \div
134
+ 5 => 0x22C4, # \diamond
135
+ 6 => 0xB1, # \pm
136
+ 7 => 0x2213, # \mp
137
+ [8,0xC] => 0x2295, # \oplus, \ominus, \otimes, \oslash, \odot
138
+ 0xD => 0x25EF, # \bigcirc
139
+ [0xE,0xF] => 0x2218, # \circ, \bullet
140
+
141
+ 0x10 => 0x224D, # \asymp
142
+ 0x11 => 0x2261, # \equiv
143
+ [0x12,0x13] => 0x2286, # \subseteq, \supseteq
144
+ [0x14,0x15] => 0x2264, # \leq, \geq
145
+ [0x16,0x17] => 0x2AAF, # \preceq, \succeq
146
+ 0x18 => 0x223C, # \sim
147
+ 0x19 => 0x2248, # \approx
148
+ [0x1A,0x1B] => 0x2282, # \subset, \supset
149
+ [0x1C,0x1D] => 0x226A, # \ll, \gg
150
+ [0x1E,0x1F] => 0x227A, # \prec, \succ
151
+
152
+ 0x20 => 0x2190, # \leftarrow
153
+ 0x21 => 0x2192, # \rightarrow
154
+ 0x22 => 0x2191, # \uparrow
155
+ 0x23 => 0x2193, # \downarrow
156
+ 0x24 => 0x2194, # \leftrightarrow
157
+ 0x25 => 0x2197, # \nearrow
158
+ 0x26 => 0x2198, # \searrow
159
+ 0x27 => 0x2243, # \simeq
160
+
161
+ 0x28 => 0x21D0, # \Leftarrow
162
+ 0x29 => 0x21D2, # \Rightarrow
163
+ 0x2A => 0x21D1, # \Uparrow
164
+ 0x2B => 0x21D3, # \Downarrow
165
+ 0x2C => 0x21D4, # \Leftrightarrow
166
+ 0x2D => 0x2196, # \nwarrow
167
+ 0x2E => 0x2199, # \swarrow
168
+ 0x2F => 0x221D, # \propto
169
+
170
+ 0x30 => 0x2032, # \prime
171
+ 0x31 => 0x221E, # \infty
172
+ 0x32 => 0x2208, # \in
173
+ 0x33 => 0x220B, # \ni
174
+ 0x34 => 0x25B3, # \bigtriangleup and \triangle
175
+ 0x35 => 0x25BD, # \bigtriangledown
176
+ 0x36 => 0xE020, # \not (U+0338 COMBINING LONG SOLIDUS OVERLAY would
177
+ # be most natural, but we don't use a negative
178
+ # leading space, so use PUA character)
179
+
180
+ 0x38 => 0x2200, # \forall
181
+ 0x39 => 0x2203, # \exists
182
+ 0x3A => 0xAC, # \neg
183
+ 0x3B => 0x2205, # \emptyset
184
+ 0x3C => 0x211C, # \Re
185
+ 0x3D => 0x2111, # \Im
186
+ 0x3E => 0x22A4, # \top
187
+ 0x3F => 0x22A5, # \bot
188
+
189
+ 0x40 => 0x2135, # \aleph
190
+
191
+ 0x5B => 0x222A, # \cup
192
+ 0x5C => 0x2229, # \cap
193
+ 0x5D => 0x228E, # \uplus
194
+ [0x5E,0x5F] => 0x2227, # \wedge, \vee
195
+
196
+ [0x60,0x61] => 0x22A2, # \vdash, \dashv
197
+ [0x62,0x63] => 0x230A, # \lfloor, \rfloor
198
+ [0x64,0x65] => 0x2308, # \lceil, \rceil
199
+ 0x66 => 0x7B, # {
200
+ 0x67 => 0x7D, # }
201
+ [0x68,0x69] => 0x27E8, # \langle, \rangle
202
+ 0x6A => 0x7C, # |
203
+ 0x6A => 0x2223, # \vert
204
+ 0x6B => 0x2225, # \Vert
205
+ 0x6C => 0x2195, # \updownarrow
206
+ 0x6D => 0x21D5, # \Updownarrow
207
+ 0x6E => 0x5C, # \backslash
208
+ 0x6E => 0x2216, # \setminus
209
+ 0x6F => 0x2240, # \wr
210
+
211
+ 0x70 => [0x221A,0,760], # \surd ### adjust position so font doesn't have a large depth
212
+ 0x71 => 0x2A3F, # \amalg
213
+ 0x72 => 0x2207, # \nabla
214
+ 0x73 => 0x222B, # \int
215
+ 0x74 => 0x2294, # \sqcup
216
+ 0x75 => 0x2293, # \sqcap
217
+ [0x76,0x77] => 0x2291, # \sqsubseteq, \sqsupseteq
218
+ 0x78 => 0xA7, # \S
219
+ [0x79,0x7A] => 0x2020, # \dagger, \ddagger
220
+ 0x7B => 0xB6, # \P
221
+ 0x7C => 0x2663, # \clubsuit
222
+ 0x7D => 0x2662, # \diamondsuit
223
+ 0x7E => 0x2661, # \heartsuit
224
+ 0x7F => 0x2660, # \spadesuit
225
+ ],
226
+
227
+ "Caligraphic" => [
228
+ [0x41,0x5A] => 0x41, # A-Z
229
+ ],
230
+ };
231
+
232
+ $map{cmex10} = {
233
+ "Size1" => [
234
+ 0 => [0x28,0,810], # (
235
+ 1 => [0x29,0,810], # )
236
+ 2 => [0x5B,0,810], # [
237
+ 3 => [0x5D,0,810], # ]
238
+ 4 => [0x230A,0,810], # \lfloor
239
+ 5 => [0x230B,0,810], # \rfloor
240
+ 6 => [0x2308,0,810], # \lceil
241
+ 7 => [0x2309,0,810], # \rceil
242
+ 8 => [0x7B,0,810], # {
243
+ 9 => [0x7D,0,810], # }
244
+ 0xA => [0x27E8,0,810], # \langle
245
+ 0xB => [0x27E9,0,810], # \rangle
246
+ 0xC => [0x2223,0,606], # \vert
247
+ 0xD => [0x2225,0,606], # \Vert
248
+ 0xE => [0x2F,0,810], # /
249
+ 0xF => [0x5C,0,810], # \
250
+
251
+ 0x46 => [0x2A06,0,750], # \bigsqcup
252
+ 0x48 => [0x222E,0,805], # \oint
253
+ 0x4A => [0x2A00,0,750], # \bigodot
254
+ 0x4C => [0x2A01,0,750], # \bigoplus
255
+ 0x4E => [0x2A02,0,750], # \bigotimes
256
+
257
+ 0x50 => [0x2211,0,750], # \sum
258
+ 0x51 => [0x220F,0,750], # \prod
259
+ 0x52 => [0x222B,0,805], # \int
260
+ 0x53 => [0x22C3,0,750], # \bigcup
261
+ 0x54 => [0x22C2,0,750], # \bigcap
262
+ 0x55 => [0x2A04,0,750], # \biguplus
263
+ 0x56 => [0x22C0,0,750], # \bigwedge
264
+ 0x57 => [0x22C1,0,750], # \bigvee
265
+
266
+ 0x60 => [0x2210,0,750], # \coprod
267
+ 0x62 => 0x2C6, # \widehat
268
+ 0x62 => [0x302,-556,0], # \widehat (combining)
269
+ 0x65 => 0x2DC, # \widetilde
270
+ 0x65 => [0x303,-556,0], # \widetilde (combining)
271
+
272
+ 0x70 => [0x221A,0,810], # surd
273
+ 0x3F => [0x23D0,0,601], # arrow extension
274
+ 0x77 => [0x2016,0,601], # Arrow extension (non-standard)
275
+ 0x78 => [0x2191,0,600], # uparrow top
276
+ 0x79 => [0x2193,0,600], # downarrow bottom
277
+ 0x7E => [0x21D1,0,600], # Uparrow top
278
+ 0x7F => [0x21D3,0,600], # Downarrow bottom
279
+ ],
280
+
281
+ "Size2" => [
282
+ 0x10 => [0x28,0,1110], # (
283
+ 0x11 => [0x29,0,1110], # )
284
+ 0x2E => [0x2F,0,1110], # /
285
+ 0x2F => [0x5C,0,1110], # \
286
+ 0x44 => [0x27E8,0,1110],# \langle
287
+ 0x45 => [0x27E9,0,1110],# \rangle
288
+
289
+ 0x47 => [0x2A06,0,950], # \bigsqcup
290
+ 0x49 => [0x222E,0,1360],# \oint
291
+ 0x4B => [0x2A00,0,950], # \bigodot
292
+ 0x4D => [0x2A01,0,950], # \bigoplus
293
+ 0x4F => [0x2A02,0,950], # \bigotimes
294
+
295
+ 0x58 => [0x2211,0,950], # \sum
296
+ 0x59 => [0x220F,0,950], # \prod
297
+ 0x5A => [0x222B,0,1360],# \int
298
+ 0x5B => [0x22C3,0,950], # \bigcup
299
+ 0x5C => [0x22C2,0,950], # \bigcap
300
+ 0x5D => [0x2A04,0,950], # \biguplus
301
+ 0x5E => [0x22C0,0,950], # \bigwedge
302
+ 0x5F => [0x22C1,0,950], # \bigvee
303
+ 0x61 => [0x2210,0,950], # \coprod
304
+
305
+ 0x63 => 0x2C6, # \widehat
306
+ 0x63 => [0x302,-1000,0],# \widehat (combining)
307
+ 0x66 => 0x2DC, # \widetilde
308
+ 0x66 => [0x303,-1000,0],# \widetilde (combining)
309
+
310
+ 0x68 => [0x5B,0,1110], # [
311
+ 0x69 => [0x5D,0,1110], # ]
312
+ 0x6A => [0x230A,0,1110],# \lfloor
313
+ 0x6B => [0x230B,0,1110],# \rfloor
314
+ 0x6C => [0x2308,0,1110],# \lceil
315
+ 0x6D => [0x2309,0,1110],# \rceil
316
+ 0x6E => [0x7B,0,1110], # {
317
+ 0x6F => [0x7D,0,1110], # }
318
+ 0x71 => [0x221A,0,1110],# surd
319
+ ],
320
+
321
+ "Size3" => [
322
+ 0x12 => [0x28,0,1410], # (
323
+ 0x13 => [0x29,0,1410], # )
324
+ 0x14 => [0x5B,0,1410], # [
325
+ 0x15 => [0x5D,0,1410], # ]
326
+ 0x16 => [0x230A,0,1410],# \lfloor
327
+ 0x17 => [0x230B,0,1410],# \rfloor
328
+ 0x18 => [0x2308,0,1410],# \lceil
329
+ 0x19 => [0x2309,0,1410],# \rceil
330
+ 0x1A => [0x7B,0,1410], # {
331
+ 0x1B => [0x7D,0,1410], # }
332
+ 0x1C => [0x27E8,0,1410],# \langle
333
+ 0x1D => [0x27E9,0,1410],# \rangle
334
+ 0x1E => [0x2F,0,1410], # /
335
+ 0x1F => [0x5C,0,1410], # \
336
+ 0x64 => 0x2C6, # \widehat
337
+ 0x64 => [0x302,-1444,0],# \widehat (combining)
338
+ 0x67 => 0x2DC, # \widetilde
339
+ 0x67 => [0x303,-1444,0],# \widetilde (combining)
340
+ 0x72 => [0x221A,0,1410],# surd
341
+ ],
342
+
343
+ "Size4" => [
344
+ 0x20 => [0x28,0,1710], # (
345
+ 0x21 => [0x29,0,1710], # )
346
+ 0x22 => [0x5B,0,1710], # [
347
+ 0x23 => [0x5D,0,1710], # ]
348
+ 0x24 => [0x230A,0,1710],# \lfloor
349
+ 0x25 => [0x230B,0,1710],# \rfloor
350
+ 0x26 => [0x2308,0,1710],# \lceil
351
+ 0x27 => [0x2309,0,1710],# \rceil
352
+ 0x28 => [0x7B,0,1710], # {
353
+ 0x29 => [0x7D,0,1710], # }
354
+ 0x2A => [0x27E8,0,1710],# \langle
355
+ 0x2B => [0x27E9,0,1710],# \rangle
356
+ 0x2C => [0x2F,0,1710], # /
357
+ 0x2D => [0x5C,0,1710], # \
358
+ 0x73 => [0x221A,0,1710],# surd
359
+
360
+ 0x30 => [0x239B,0,1115],# left paren upper hook
361
+ 0x31 => [0x239E,0,1115],# right paren upper hook
362
+ 0x32 => [0x23A1,0,1115],# left square bracket upper corner
363
+ 0x33 => [0x23A4,0,1115],# right square bracket upper corner
364
+ 0x34 => [0x23A3,0,1115],# left square bracket lower corner
365
+ 0x35 => [0x23A6,0,1115],# right square bracket lower hook
366
+ 0x36 => [0x23A2,0,601], # left square bracket extension
367
+ 0x37 => [0x23A5,0,601], # right square bracket extension
368
+ 0x38 => [0x23A7,0,900], # left curly brace upper hook
369
+ 0x39 => [0x23AB,0,900], # right curly brace upper hook
370
+ 0x3A => 0x23A9, # left curly brace lower hook
371
+ 0x3B => 0x23AD, # right curly brace lower hook
372
+ 0x3C => [0x23A8,0,1150],# left curly brace middle
373
+ 0x3D => [0x23AC,0,1150],# right curly brace middle
374
+ 0x3E => [0x23AA,0,300], # curly brace extension
375
+
376
+ 0x40 => [0x239D,0,1115],# left paren lower hook
377
+ 0x41 => [0x23A0,0,1115],# right paren lower hook
378
+ 0x42 => [0x239C,0,600], # left paren extension
379
+ 0x43 => [0x239F,0,600], # right paren extension
380
+
381
+ 0x74 => [0x23B7,0,915], # radical bottom
382
+ 0x75 => [0xE000,0,605], # radical extension (PUA)
383
+ 0x76 => [0xE001,0,565], # radical top (PUA)
384
+ [0x7A,0x7D] => 0xE150, # \braceld, \bracerd, \bracelu, \braceru (PUA)
385
+ ],
386
+
387
+ "Main-Regular" => [
388
+ 0x38 => [0x23B0,0,900], # left curly brace upper hook, for lgroup, lmoustache
389
+ 0x39 => [0x23B1,0,900], # right curly brace upper hook, for rgroup, rmoustache
390
+ 0x3A => 0x23A9, # left curly brace lower hook, for lgroup, rmoustache
391
+ 0x3B => 0x23AD, # right curly brace lower hook, for rgroup, lmoustache
392
+ ],
393
+ };
394
+
395
+ $map{cmti10} = {
396
+ "Main-Italic" => [
397
+ [0,1] => 0x393, # \Gamma, \Delta
398
+ 2 => 0x398, # \Theta
399
+ 3 => 0x39B, # \Lambda
400
+ 4 => 0x39E, # \Xi
401
+ 5 => 0x3A0, # \Pi
402
+ 6 => 0x3A3, # \Sigma
403
+ [7,8] => 0x3A5, # \Upsilon, \Phi
404
+ [9,0xA] => 0x3A8, # \Psi, \Omega
405
+
406
+ 0x10 => 0x131, # \i
407
+ 0x11 => 0x237, # \j
408
+ 0x12 => 0x2CB, # \grave
409
+ 0x13 => 0x2CA, # \acute
410
+ 0x14 => 0x2C7, # \check
411
+ 0x15 => 0x2D8, # \breve
412
+ 0x16 => 0x2C9, # \bar
413
+ 0x17 => [0xB0,-160,0], # \degree
414
+ 0x17 => 0x02DA, # \r, ring above
415
+ 0x18 => 0xB8, # \c, cedilla
416
+
417
+ [0x21,0x23] => 0x21, # !, ", #,
418
+ 0x22 => 0x201D, # "
419
+ [0x25,0x2F] => 0x25, # %, &, ', (, ), *, +, comma, -, ., /
420
+ 0x27 => 0x2019, # '
421
+ [0x30,0x39] => 0x30, # 0-9
422
+ [0x3A,0x3B] => 0x3A, # :, ;
423
+ 0x3D => 0x3D, # =
424
+ [0x3F,0x40] => 0x3F, # ?, @
425
+ [0x41,0x5A] => 0x41, # A-Z
426
+ 0x5B => 0x5B, # [
427
+ 0x5C => 0x201C, # ``
428
+ [0x5D,0x5E] => 0x5D, # ], ^
429
+ 0x5E => 0x2C6, # \hat
430
+ 0x5F => 0x2D9, # \dot
431
+ 0x60 => 0x2018, # `
432
+ [0x61,0x7A] => 0x61, # a-z
433
+ [0x7B,0x7C] => 0x2013, # \endash, \emdash
434
+ 0x7B => [0x5F,0,-310], # underline
435
+ 0x7D => 0x2DD, # double acute
436
+ 0x7E => [0x7E,0,-350], # ~
437
+ 0x7E => 0x2DC, # \tilde
438
+ 0x7F => 0xA8, # \ddot
439
+ 0x19 => 0xDF, # sharp S
440
+ 0x1A => 0xE6, # ae ligature
441
+ 0x1B => 0x153, # oe ligature
442
+ 0x1C => 0xF8, # o with slash
443
+ 0x1D => 0xC6, # AE ligature
444
+ 0x1E => 0x152, # OE ligature
445
+ 0x1F => 0xD8, # O with slash
446
+ ],
447
+
448
+ "Main-Regular" => [
449
+ 0x24 => 0xA3, # pound sign
450
+ ],
451
+ };
452
+
453
+ $map{cmbx10} = {
454
+ "Main-Bold" => [
455
+ [0,1] => 0x393, # \Gamma, \Delta
456
+ 2 => 0x398, # \Theta
457
+ 3 => 0x39B, # \Lambda
458
+ 4 => 0x39E, # \Xi
459
+ 5 => 0x3A0, # \Pi
460
+ 6 => 0x3A3, # \Sigma
461
+ [7,8] => 0x3A5, # \Upsilon, \Phi
462
+ [9,0xA] => 0x3A8, # \Psi, \Omega
463
+
464
+ 0x10 => 0x131, # \i
465
+ 0x11 => 0x237, # \j
466
+ 0x12 => 0x2CB, # \grave
467
+ 0x13 => 0x2CA, # \acute
468
+ 0x14 => 0x2C7, # \check
469
+ 0x15 => 0x2D8, # \breve
470
+ 0x16 => 0x2C9, # \bar
471
+ 0x17 => [0xB0,-147,0], # \degree
472
+ 0x17 => 0x02DA, # \r, ring above
473
+ 0x18 => 0xB8, # \c, cedilla
474
+
475
+ [0x21,0x2F] => 0x21, # !, ", #, $, %, &, ', (, ), *, +, comma, -, ., /
476
+ 0x22 => 0x201D, # "
477
+ 0x27 => 0x2019, # '
478
+ [0x30,0x39] => 0x30, # 0-9
479
+ [0x3A,0x3B] => 0x3A, # :, ;
480
+ 0x3D => 0x3D, # =
481
+ [0x3F,0x40] => 0x3F, # ?, @
482
+ [0x41,0x5A] => 0x41, # A-Z
483
+ 0x5B => 0x5B, # [
484
+ 0x5C => 0x201C, # ``
485
+ [0x5D,0x5E] => 0x5D, # ], ^
486
+ 0x5E => 0x2C6, # \hat
487
+ 0x5F => 0x2D9, # \dot
488
+ 0x60 => 0x2018, # `
489
+ [0x61,0x7A] => 0x61, # a-z
490
+ [0x7B,0x7C] => 0x2013, # \endash, \emdash
491
+ 0x7B => [0x5F,0,-310], # underline
492
+ 0x7D => 0x2DD, # double acute
493
+ 0x7E => [0x7E,0,-350], # ~
494
+ 0x7E => 0x2DC, # \tilde
495
+ 0x7F => 0xA8, # \ddot
496
+ 0x19 => 0xDF, # sharp S
497
+ 0x1A => 0xE6, # ae ligature
498
+ 0x1B => 0x153, # oe ligature
499
+ 0x1C => 0xF8, # o with slash
500
+ 0x1D => 0xC6, # AE ligature
501
+ 0x1E => 0x152, # OE ligature
502
+ 0x1F => 0xD8, # O with slash
503
+ ],
504
+ };
505
+
506
+ $map{cmbxti10} = {
507
+ "Main-BoldItalic" => [
508
+ [0,1] => 0x393, # \Gamma, \Delta
509
+ 2 => 0x398, # \Theta
510
+ 3 => 0x39B, # \Lambda
511
+ 4 => 0x39E, # \Xi
512
+ 5 => 0x3A0, # \Pi
513
+ 6 => 0x3A3, # \Sigma
514
+ [7,8] => 0x3A5, # \Upsilon, \Phi
515
+ [9,0xA] => 0x3A8, # \Psi, \Omega
516
+
517
+ 0x10 => 0x131, # \i
518
+ 0x11 => 0x237, # \j
519
+ 0x12 => 0x2CB, # \grave
520
+ 0x13 => 0x2CA, # \acute
521
+ 0x14 => 0x2C7, # \check
522
+ 0x15 => 0x2D8, # \breve
523
+ 0x16 => 0x2C9, # \bar
524
+ 0x17 => [0xB0,-160,0], # \degree
525
+ 0x17 => 0x02DA, # \r, ring above
526
+ 0x18 => 0xB8, # \c, cedilla
527
+
528
+ [0x21,0x23] => 0x21, # !, ", #,
529
+ 0x22 => 0x201D, # "
530
+ [0x25,0x2F] => 0x25, # %, &, ', (, ), *, +, comma, -, ., /
531
+ 0x27 => 0x2019, # '
532
+ [0x30,0x39] => 0x30, # 0-9
533
+ [0x3A,0x3B] => 0x3A, # :, ;
534
+ 0x3D => 0x3D, # =
535
+ [0x3F,0x40] => 0x3F, # ?, @
536
+ [0x41,0x5A] => 0x41, # A-Z
537
+ 0x5B => 0x5B, # [
538
+ 0x5C => 0x201C, # ``
539
+ [0x5D,0x5E] => 0x5D, # ], ^
540
+ 0x5E => 0x2C6, # \hat
541
+ 0x5F => 0x2D9, # \dot
542
+ 0x60 => 0x2018, # `
543
+ [0x61,0x7A] => 0x61, # a-z
544
+ [0x7B,0x7C] => 0x2013, # \endash, \emdash
545
+ 0x7B => [0x5F,0,-310], # underline
546
+ 0x7D => 0x2DD, # double acute
547
+ 0x7E => [0x7E,0,-350], # ~
548
+ 0x7E => 0x2DC, # \tilde
549
+ 0x7F => 0xA8, # \ddot
550
+ 0x19 => 0xDF, # sharp S
551
+ 0x1A => 0xE6, # ae ligature
552
+ 0x1B => 0x153, # oe ligature
553
+ 0x1C => 0xF8, # o with slash
554
+ 0x1D => 0xC6, # AE ligature
555
+ 0x1E => 0x152, # OE ligature
556
+ 0x1F => 0xD8, # O with slash
557
+ ],
558
+
559
+ "Main-Bold" => [
560
+ 0x24 => 0xA3, # pound sign
561
+ ],
562
+ };
563
+
564
+ $map{cmmib10} = {
565
+ "Math-BoldItalic" => [
566
+ [0,1] => 0x393, # \Gamma, \Delta
567
+ 2 => 0x398, # \Theta
568
+ 3 => 0x39B, # \Lambda
569
+ 4 => 0x39E, # \Xi
570
+ 5 => 0x3A0, # \Pi
571
+ 6 => 0x3A3, # \Sigma
572
+ [7,8] => 0x3A5, # \Upsilon, \Phi
573
+ [9,0xA] => 0x3A8, # \Psi, \Omega
574
+
575
+ [0xB,0xE] => 0x3B1, # \alpha, \beta, \gamma, \delta
576
+ 0xF => 0x3F5, # \elpsilon
577
+ [0x10,0x18] => 0x3B6, # \zeta, \eta, \theta, \iota, \kappa, \lambda, \mu, \nu, \xi
578
+ [0x19,0x1A] => 0x3C0, # \pi, \rho
579
+ [0x1B,0x1D] => 0x3C3, # \sigma, \tau, \upsilon
580
+ 0x1E => 0x3D5, # \phi
581
+ [0x1F,0x21] => 0x3C7, # \chi, \psi, \omega
582
+ 0x22 => 0x3B5, # \varepsilon
583
+ 0x23 => 0x3D1, # \vartheta
584
+ 0x24 => 0x3D6, # \varpi
585
+ 0x25 => 0x3F1, # \varrho
586
+ 0x26 => 0x3C2, # \varsigma
587
+ 0x27 => 0x3C6, # \varphi
588
+
589
+ [0x30,0x39] => 0x30, # Oldstyle 0-9
590
+ [0x41,0x5A] => 0x41, # A-Z
591
+ [0x61,0x7A] => 0x61, # a - z
592
+
593
+ 0x6F => 0x3BF, # omicron
594
+ 0x7B => 0xE131, # \imath (PUA)
595
+ 0x7C => 0xE237, # \jmath (PUA)
596
+ ],
597
+
598
+ "Main-Bold" => [
599
+ 0x28 => 0x21BC, # \leftharpoonup
600
+ 0x29 => 0x21BD, # \leftharpoondown
601
+ 0x2A => 0x21C0, # \rightharpoonup
602
+ 0x2B => 0x21C1, # \rightharpoondown
603
+
604
+ 0x2E => 0x25B9, # \triangleright
605
+ 0x2F => 0x25C3, # \triangleleft
606
+
607
+ 0x3A => 0x2E, # .
608
+ 0x3B => 0x2C, # ,
609
+ 0x3C => 0x3C, # <
610
+ 0x3D => 0x2215, # /
611
+ 0x3E => 0x3E, # >
612
+ 0x3F => 0x22C6, # \star
613
+ 0x40 => 0x2202, # \partial
614
+
615
+ [0x5B,0x5D] => 0x266D, # \flat, \natural, \sharp
616
+ 0x5E => 0x2323, # \smile
617
+ 0x5F => 0x2322, # \frown
618
+ 0x60 => 0x2113, # \ell
619
+ 0x68 => 0x210F, # \hbar (bar added below)
620
+
621
+ 0x7D => 0x2118, # \wp
622
+ 0x7E => [0x20D7,-729,0],# \vec
623
+ ],
624
+ };
625
+
626
+ $map{cmbsy10} = {
627
+ "Main-Bold" => [
628
+ [0,1] => 0x2212, # -
629
+ 1 => 0x22C5, # \cdot
630
+ 2 => 0xD7, # \times
631
+ 3 => 0x2217, # \ast
632
+ 4 => 0xF7, # \div
633
+ 5 => 0x22C4, # \diamond
634
+ 6 => 0xB1, # \pm
635
+ 7 => 0x2213, # \mp
636
+ [8,0xC] => 0x2295, # \oplus, \ominus, \otimes, \oslash, \odot
637
+ 0xD => 0x25EF, # \bigcirc
638
+ [0xE,0xF] => 0x2218, # \circ, \bullet
639
+
640
+ 0x10 => 0x224D, # \asymp
641
+ 0x11 => 0x2261, # \equiv
642
+ [0x12,0x13] => 0x2286, # \subseteq, \supseteq
643
+ [0x14,0x15] => 0x2264, # \leq, \geq
644
+ [0x16,0x17] => 0x2AAF, # \preceq, \succeq
645
+ 0x18 => 0x223C, # \sim
646
+ 0x19 => 0x2248, # \approx
647
+ [0x1A,0x1B] => 0x2282, # \subset, \supset
648
+ [0x1C,0x1D] => 0x226A, # \ll, \gg
649
+ [0x1E,0x1F] => 0x227A, # \prec, \succ
650
+
651
+ 0x20 => 0x2190, # \leftarrow
652
+ 0x21 => 0x2192, # \rightarrow
653
+ 0x22 => 0x2191, # \uparrow
654
+ 0x23 => 0x2193, # \downarrow
655
+ 0x24 => 0x2194, # \leftrightarrow
656
+ 0x25 => 0x2197, # \nearrow
657
+ 0x26 => 0x2198, # \searrow
658
+ 0x27 => 0x2243, # \simeq
659
+
660
+ 0x28 => 0x21D0, # \Leftarrow
661
+ 0x29 => 0x21D2, # \Rightarrow
662
+ 0x2A => 0x21D1, # \Uparrow
663
+ 0x2B => 0x21D3, # \Downarrow
664
+ 0x2C => 0x21D4, # \Leftrightarrow
665
+ 0x2D => 0x2196, # \nwarrow
666
+ 0x2E => 0x2199, # \swarrow
667
+ 0x2F => 0x221D, # \propto
668
+
669
+ 0x30 => 0x2032, # \prime
670
+ 0x31 => 0x221E, # \infty
671
+ 0x32 => 0x2208, # \in
672
+ 0x33 => 0x220B, # \ni
673
+ 0x34 => 0x25B3, # \bigtriangleup and \triangle
674
+ 0x35 => 0x25BD, # \bigtriangledown
675
+ 0x36 => 0xE020, # \not
676
+
677
+ 0x38 => 0x2200, # \forall
678
+ 0x39 => 0x2203, # \exists
679
+ 0x3A => 0xAC, # \neg
680
+ 0x3B => 0x2205, # \emptyset
681
+ 0x3C => 0x211C, # \Re
682
+ 0x3D => 0x2111, # \Im
683
+ 0x3E => 0x22A4, # \top
684
+ 0x3F => 0x22A5, # \bot
685
+
686
+ 0x40 => 0x2135, # \aleph
687
+
688
+ 0x5B => 0x222A, # \cup
689
+ 0x5C => 0x2229, # \cap
690
+ 0x5D => 0x228E, # \uplus
691
+ [0x5E,0x5F] => 0x2227, # \wedge, \vee
692
+
693
+ [0x60,0x61] => 0x22A2, # \vdash, \dashv
694
+ [0x62,0x63] => 0x230A, # \lfloor, \rfloor
695
+ [0x64,0x65] => 0x2308, # \lceil, \rceil
696
+ 0x66 => 0x7B, # {
697
+ 0x67 => 0x7D, # }
698
+ [0x68,0x69] => 0x27E8, # \langle, \rangle
699
+ 0x6A => 0x7C, # |
700
+ 0x6A => 0x2223, # \vert
701
+ 0x6B => 0x2225, # \Vert
702
+ 0x6C => 0x2195, # \updownarrow
703
+ 0x6D => 0x21D5, # \Updownarrow
704
+ 0x6E => 0x5C, # \backslash
705
+ 0x6E => 0x2216, # \setminus
706
+ 0x6F => 0x2240, # \wr
707
+
708
+ 0x70 => [0x221A,0,760], # \surd ### adjust position so font doesn't have a large depth
709
+ 0x71 => 0x2A3F, # \amalg
710
+ 0x72 => 0x2207, # \nabla
711
+ 0x73 => 0x222B, # \int
712
+ 0x74 => 0x2294, # \sqcup
713
+ 0x75 => 0x2293, # \sqcap
714
+ [0x76,0x77] => 0x2291, # \sqsubseteq, \sqsupseteq
715
+
716
+ [0x79,0x7A] => 0x2020, # \dagger, \ddagger
717
+
718
+ 0x7C => 0x2663, # \clubsuit
719
+ 0x7D => 0x2662, # \diamondsuit
720
+ 0x7E => 0x2661, # \heartsuit
721
+ 0x7F => 0x2660, # \spadesuit
722
+ ],
723
+
724
+ "Caligraphic-Bold" => [
725
+ [0x41,0x5A] => 0x41, # A-Z
726
+ ],
727
+ };
728
+
729
+ $map{msam10} = {
730
+ "Main-Regular" => [
731
+ 0x5C => 0x2220, # \angle
732
+ ],
733
+
734
+ "Main-Bold" => [
735
+ 0x5C => 0x2220, # \angle (emboldened below)
736
+ ],
737
+
738
+ "AMS" => [
739
+ 0x00 => 0x22A1, # \boxdot
740
+ 0x01 => 0x229E, # \boxplus
741
+ 0x02 => 0x22A0, # \boxtimes
742
+ 0x03 => 0x25A1, # \square
743
+ 0x04 => 0x25A0, # \blacksquare
744
+ 0x05 => 0x22C5, # \centerdot
745
+ 0x06 => 0x25CA, # \lozenge
746
+ 0x07 => 0x29EB, # \blacklozenge
747
+ 0x08 => 0x21BB, # \circlearrowright
748
+ 0x09 => 0x21BA, # \circlearrowleft
749
+ 0x0A => 0x21CC, # \rightleftharpoons
750
+ 0x0B => 0x21CB, # \leftrightharpoons
751
+ 0x0C => 0x229F, # \boxminus
752
+ 0x0D => 0x22A9, # \Vdash
753
+ 0x0E => 0x22AA, # \Vvdash
754
+ 0x0F => 0x22A8, # \vDash
755
+ 0x10 => 0x21A0, # \twoheadrightarrow
756
+ 0x11 => 0x219E, # \twoheadleftarrow
757
+ 0x12 => 0x21C7, # \leftleftarrows
758
+ 0x13 => 0x21C9, # \rightrightarrows
759
+ 0x14 => 0x21C8, # \upuparrows
760
+ 0x15 => 0x21CA, # \downdownarrows
761
+ 0x16 => 0x21BE, # \upharpoonright
762
+ 0x17 => 0x21C2, # \downharpoonright
763
+ 0x18 => 0x21BF, # \upharpoonleft
764
+ 0x19 => 0x21C3, # \downharpoonleft
765
+ 0x1A => 0x21A3, # \rightarrowtail
766
+ 0x1B => 0x21A2, # \leftarrowtail
767
+ 0x1C => 0x21C6, # \leftrightarrows
768
+ 0x1D => 0x21C4, # \rightleftarrows
769
+ 0x1E => 0x21B0, # \Lsh
770
+ 0x1F => 0x21B1, # \Rsh
771
+ 0x20 => 0x21DD, # \rightsquigarrow
772
+ 0x21 => 0x21AD, # \leftrightsquigarrow
773
+ 0x22 => 0x21AB, # \looparrowleft
774
+ 0x23 => 0x21AC, # \looparrowright
775
+ 0x24 => 0x2257, # \circeq
776
+ 0x25 => 0x227F, # \succsim
777
+ 0x26 => 0x2273, # \gtrsim
778
+ 0x27 => 0x2A86, # \gtrapprox
779
+ 0x28 => 0x22B8, # \multimap
780
+ 0x29 => 0x2234, # \therefore
781
+ 0x2A => 0x2235, # \because
782
+ 0x2B => 0x2251, # \doteqdot
783
+ 0x2C => 0x225C, # \triangleq
784
+ 0x2D => 0x227E, # \precsim
785
+ 0x2E => 0x2272, # \lesssim
786
+ 0x2F => 0x2A85, # \lessapprox
787
+ 0x30 => 0x2A95, # \eqslantless
788
+ 0x31 => 0x2A96, # \eqslantgtr
789
+ 0x32 => 0x22DE, # \curlyeqprec
790
+ 0x33 => 0x22DF, # \curlyeqsucc
791
+ 0x34 => 0x227C, # \preccurlyeq
792
+ 0x35 => 0x2266, # \leqq
793
+ 0x36 => 0x2A7D, # \leqslant
794
+ 0x37 => 0x2276, # \lessgtr
795
+ 0x38 => 0x2035, # \backprime
796
+ 0x39 => 0x2212, # dahsed arrow extension
797
+ 0x3A => 0x2253, # \risingdotseq
798
+ 0x3B => 0x2252, # \fallingdotseq
799
+ 0x3C => 0x227D, # \succcurlyeq
800
+ 0x3D => 0x2267, # \geqq
801
+ 0x3E => 0x2A7E, # \geqslant
802
+ 0x3F => 0x2277, # \gtrless
803
+ 0x40 => 0x228F, # \sqsubset
804
+ 0x41 => 0x2290, # \sqsupset
805
+ 0x42 => 0x22B3, # \vartriangleright
806
+ 0x43 => 0x22B2, # \vartriangleleft
807
+ 0x44 => 0x22B5, # \trianglerighteq
808
+ 0x45 => 0x22B4, # \trianglelefteq
809
+ 0x46 => 0x2605, # \bigstar
810
+ 0x47 => 0x226C, # \between
811
+ 0x48 => 0x25BC, # \blacktriangledown
812
+ 0x49 => 0x25B6, # \blacktriangleright
813
+ 0x4A => 0x25C0, # \blacktriangleleft
814
+ 0x4B => 0x2192, # rightarrow
815
+ 0x4C => 0x2190, # leftarrow
816
+ 0x4D => 0x25B3, # \vartriangle
817
+ 0x4E => 0x25B2, # \blacktriangle
818
+ 0x4F => 0x25BD, # \triangledown
819
+ 0x50 => 0x2256, # \eqcirc
820
+ 0x51 => 0x22DA, # \lesseqgtr
821
+ 0x52 => 0x22DB, # \gtreqless
822
+ 0x53 => 0x2A8B, # \lesseqqgtr
823
+ 0x54 => 0x2A8C, # \gtreqqless
824
+ 0x55 => 0x00A5, # yen
825
+ 0x56 => 0x21DB, # \Rrightarrow
826
+ 0x57 => 0x21DA, # \Lleftarrow
827
+ 0x58 => 0x2713, # checkmark
828
+ 0x59 => 0x22BB, # \veebar
829
+ 0x5A => 0x22BC, # \barwedge
830
+ 0x5B => 0x2A5E, # \doublebarwedge
831
+ 0x5C => 0x2220, # \angle
832
+ 0x5D => 0x2221, # \measuredangle
833
+ 0x5E => 0x2222, # \sphericalangle
834
+ 0x5F => 0x221D, # \varpropto
835
+ 0x60 => 0x2323, # \smallsmile
836
+ 0x61 => 0x2322, # \smallfrown
837
+ 0x62 => 0x22D0, # \Subset
838
+ 0x63 => 0x22D1, # \Supset
839
+ 0x64 => 0x22D3, # \Cup
840
+ 0x65 => 0x22D2, # \Cap
841
+ 0x66 => 0x22CF, # \curlywedge
842
+ 0x67 => 0x22CE, # \curlyvee
843
+ 0x68 => 0x22CB, # \leftthreetimes
844
+ 0x69 => 0x22CC, # \rightthreetimes
845
+ 0x6A => 0x2AC5, # \subseteqq
846
+ 0x6B => 0x2AC6, # \supseteqq
847
+ 0x6C => 0x224F, # \bumpeq
848
+ 0x6D => 0x224E, # \Bumpeq
849
+ 0x6E => 0x22D8, # \lll
850
+ 0x6F => 0x22D9, # \ggg
851
+ 0x70 => 0x250C, # \ulcorner
852
+ 0x71 => 0x2510, # \urcorner
853
+ 0x72 => 0x00AE, # registered sign
854
+ 0x73 => 0x24C8, # \circledS
855
+ 0x74 => 0x22D4, # \pitchfork
856
+ 0x75 => 0x2214, # \dotplus
857
+ 0x76 => 0x223D, # \backsim
858
+ 0x77 => 0x22CD, # \backsimeq
859
+ 0x78 => 0x2514, # \llcorner
860
+ 0x79 => 0x2518, # \lrcorner
861
+ 0x7A => 0x2720, # maltese cross
862
+ 0x7B => 0x2201, # \complement
863
+ 0x7C => 0x22BA, # \intercal
864
+ 0x7D => 0x229A, # \circledcirc
865
+ 0x7E => 0x229B, # \circledast
866
+ 0x7F => 0x229D, # \circleddash
867
+ ],
868
+ };
869
+
870
+ $map{msbm10} = {
871
+ "Size4" => [
872
+ 0x5B => 0x2C6, # \widehat
873
+ 0x5B => [0x302,-1889,0],# \widehat (combining)
874
+ 0x5D => 0x2DC, # \widetilde
875
+ 0x5D => [0x303,-1889,0],# \widetilde (combining)
876
+ ],
877
+
878
+ "Main-Regular" => [
879
+ 0x7E => 0x210F, # \hbar
880
+ ],
881
+
882
+ "Main-Italic" => [
883
+ 0x7D => 0x210F, # \hbar (with slant)
884
+ ],
885
+
886
+ "AMS" => [
887
+ 0x00 => 0xE00C, # \lvertneqq
888
+ 0x01 => 0xE00D, # \gvertneqq
889
+ 0x02 => 0x2270, # \nleq
890
+ 0x03 => 0x2271, # \ngeq
891
+ 0x04 => 0x226E, # \nless
892
+ 0x05 => 0x226F, # \ngtr
893
+ 0x06 => 0x2280, # \nprec
894
+ 0x07 => 0x2281, # \nsucc
895
+ 0x08 => 0x2268, # \lneqq
896
+ 0x09 => 0x2269, # \gneqq
897
+ 0x0A => 0xE010, # \nleqslant
898
+ 0x0B => 0xE00F, # \ngeqslant
899
+ 0x0C => 0x2A87, # \lneq
900
+ 0x0D => 0x2A88, # \gneq
901
+ 0x0E => 0x22E0, # \npreceq
902
+ 0x0F => 0x22E1, # \nsucceq
903
+ 0x10 => 0x22E8, # \precnsim
904
+ 0x11 => 0x22E9, # \succnsim
905
+ 0x12 => 0x22E6, # \lnsim
906
+ 0x13 => 0x22E7, # \gnsim
907
+ 0x14 => 0xE011, # \nleqq
908
+ 0x15 => 0xE00E, # \ngeqq
909
+ 0x16 => 0x2AB5, # \precneqq
910
+ 0x17 => 0x2AB6, # \succneqq
911
+ 0x18 => 0x2AB9, # \precnapprox
912
+ 0x19 => 0x2ABA, # \succnapprox
913
+ 0x1A => 0x2A89, # \lnapprox
914
+ 0x1B => 0x2A8A, # \gnapprox
915
+ 0x1C => 0x2241, # \nsim
916
+ 0x1D => 0x2246, # \ncong
917
+ 0x1E => 0x2571, # \diagup
918
+ 0x1F => 0x2572, # \diagdown
919
+ 0x20 => 0xE01A, # \varsubsetneq
920
+ 0x21 => 0xE01B, # \varsupsetneq
921
+ 0x22 => 0xE016, # \nsubseteqq
922
+ 0x23 => 0xE018, # \nsupseteqq
923
+ 0x24 => 0x2ACB, # \subsetneqq
924
+ 0x25 => 0x2ACC, # \supsetneqq
925
+ 0x26 => 0xE017, # \varsubsetneqq
926
+ 0x27 => 0xE019, # \varsupsetneqq
927
+ 0x28 => 0x228A, # \subsetneq
928
+ 0x29 => 0x228B, # \supsetneq
929
+ 0x2A => 0x2288, # \nsubseteq
930
+ 0x2B => 0x2289, # \nsupseteq
931
+ 0x2C => 0x2226, # \nparallel
932
+ 0x2D => 0x2224, # \nmid
933
+ 0x2E => 0xE006, # \nshortmid
934
+ 0x2F => 0xE007, # \nshortparallel
935
+ 0x30 => 0x22AC, # \nvdash
936
+ 0x31 => 0x22AE, # \nVdash
937
+ 0x32 => 0x22AD, # \nvDash
938
+ 0x33 => 0x22AF, # \nVDash
939
+ 0x34 => 0x22ED, # \ntrianglerighteq
940
+ 0x35 => 0x22EC, # \ntrianglelefteq
941
+ 0x36 => 0x22EA, # \ntriangleleft
942
+ 0x37 => 0x22EB, # \ntriangleright
943
+ 0x38 => 0x219A, # \nleftarrow
944
+ 0x39 => 0x219B, # \nrightarrow
945
+ 0x3A => 0x21CD, # \nLeftarrow
946
+ 0x3B => 0x21CF, # \nRightarrow
947
+ 0x3C => 0x21CE, # \nLeftrightarrow
948
+ 0x3D => 0x21AE, # \nleftrightarrow
949
+ 0x3E => 0x22C7, # \divideontimes
950
+ 0x3F => 0x2205, # \varnothing
951
+ 0x40 => 0x2204, # \nexists
952
+
953
+ [0x41,0x5A] => 0x41, # A-Z
954
+ 0x5C => 0x2C6, # \widehat
955
+ 0x5C => [0x302,-2333,0],# \widehat (combining)
956
+ 0x5E => 0x2DC, # \widetilde
957
+ 0x5E => [0x303,-2333,0],# \widetilde (combining)
958
+
959
+ 0x60 => 0x2132, # \Finv
960
+ 0x61 => 0x2141, # \Game
961
+ 0x66 => 0x2127, # \mho
962
+ 0x67 => 0x00F0, # \eth
963
+ 0x68 => 0x2242, # minus-tilde
964
+ 0x69 => 0x2136, # \beth
965
+ 0x6A => 0x2137, # \gimel
966
+ 0x6B => 0x2138, # \daleth
967
+ 0x6C => 0x22D6, # \lessdot
968
+ 0x6D => 0x22D7, # \gtrdot
969
+ 0x6E => 0x22C9, # \ltimes
970
+ 0x6F => 0x22CA, # \rtimes
971
+ 0x70 => 0x2223, # \shortmid
972
+ 0x71 => 0x2225, # \shortparallel
973
+ 0x72 => 0x2216, # \smallsetminus
974
+ 0x73 => 0x223C, # \thicksim
975
+ 0x74 => 0x2248, # \thickapprox
976
+ 0x75 => 0x224A, # \approxeq
977
+ 0x76 => 0x2AB8, # \succapprox
978
+ 0x77 => 0x2AB7, # \precapprox
979
+ 0x78 => 0x21B6, # \curvearrowleft
980
+ 0x79 => 0x21B7, # \curvearrowright
981
+ 0x7A => 0x03DD, # \digamma
982
+ 0x7B => 0x03F0, # \varkappa
983
+ 0x7A => 0xE008, # \digamma (non-standard, for IE)
984
+ 0x7B => 0xE009, # \varkappa (non-standard, for IE)
985
+ 0x7C => 0x006B, # \Bbbk
986
+ 0x7D => 0x210F, # \hslash
987
+ 0x7E => 0x0127, # \hbar
988
+ 0x7F => 0x220D, # \backepsilon
989
+ ],
990
+ };
991
+
992
+ $map{cmss10} = {
993
+ "SansSerif-Regular" => [
994
+ [0,1] => 0x393, # \Gamma, \Delta
995
+ 2 => 0x398, # \Theta
996
+ 3 => 0x39B, # \Lambda
997
+ 4 => 0x39E, # \Xi
998
+ 5 => 0x3A0, # \Pi
999
+ 6 => 0x3A3, # \Sigma
1000
+ [7,8] => 0x3A5, # \Upsilon, \Phi
1001
+ [9,0xA] => 0x3A8, # \Psi, \Omega
1002
+
1003
+ 0x10 => 0x131, # \i
1004
+ 0x11 => 0x237, # \j
1005
+ 0x12 => 0x2CB, # \grave
1006
+ 0x13 => 0x2CA, # \acute
1007
+ 0x14 => 0x2C7, # \check
1008
+ 0x15 => 0x2D8, # \breve
1009
+ 0x16 => 0x2C9, # \bar
1010
+ 0x17 => [0xB0,-142,0], # \degree
1011
+ 0x17 => 0x02DA, # \r, ring above
1012
+ 0x18 => 0xB8, # \c, cedilla
1013
+
1014
+ [0x21,0x2F] => 0x21, # !, ", #, $, %, &, ', (, ), *, +, comma, -, ., /
1015
+ 0x22 => 0x201D, # "
1016
+ 0x27 => 0x2019, # '
1017
+ [0x30,0x39] => 0x30, # 0-9
1018
+ [0x3A,0x3B] => 0x3A, # :, ;
1019
+ 0x3D => 0x3D, # =
1020
+ [0x3F,0x40] => 0x3F, # ?, @
1021
+ [0x41,0x5A] => 0x41, # A-Z
1022
+ 0x5B => 0x5B, # [
1023
+ 0x5C => 0x201C, # ``
1024
+ [0x5D,0x5E] => 0x5D, # ], ^
1025
+ 0x5E => 0x2C6, # \hat
1026
+ 0x5F => 0x2D9, # \dot
1027
+ 0x60 => 0x2018, # `
1028
+ [0x61,0x7A] => 0x61, # a-z
1029
+ [0x7B,0x7C] => 0x2013, # \endash, \emdash
1030
+ 0x7B => [0x5F,0,-350], # underline
1031
+ 0x7D => 0x2DD, # double acute
1032
+ 0x7E => [0x7E,0,-350], # ~
1033
+ 0x7E => 0x2DC, # \tilde
1034
+ 0x7F => 0xA8, # \ddot
1035
+ ],
1036
+ };
1037
+
1038
+ $map{cmssi10} = {
1039
+ "SansSerif-Italic" => [
1040
+ [0,1] => 0x393, # \Gamma, \Delta
1041
+ 2 => 0x398, # \Theta
1042
+ 3 => 0x39B, # \Lambda
1043
+ 4 => 0x39E, # \Xi
1044
+ 5 => 0x3A0, # \Pi
1045
+ 6 => 0x3A3, # \Sigma
1046
+ [7,8] => 0x3A5, # \Upsilon, \Phi
1047
+ [9,0xA] => 0x3A8, # \Psi, \Omega
1048
+
1049
+ 0x10 => 0x131, # \i
1050
+ 0x11 => 0x237, # \j
1051
+ 0x12 => 0x2CB, # \grave
1052
+ 0x13 => 0x2CA, # \acute
1053
+ 0x14 => 0x2C7, # \check
1054
+ 0x15 => 0x2D8, # \breve
1055
+ 0x16 => 0x2C9, # \bar
1056
+ 0x17 => [0xB0,-113,0], # \degree
1057
+ 0x17 => 0x02DA, # \r, ring above
1058
+ 0x18 => 0xB8, # \c, cedilla
1059
+
1060
+ [0x21,0x2F] => 0x21, # !, ", #, $, %, &, ', (, ), *, +, comma, -, ., /
1061
+ 0x22 => 0x201D, # "
1062
+ 0x27 => 0x2019, # '
1063
+ [0x30,0x39] => 0x30, # 0-9
1064
+ [0x3A,0x3B] => 0x3A, # :, ;
1065
+ 0x3D => 0x3D, # =
1066
+ [0x3F,0x40] => 0x3F, # ?, @
1067
+ [0x41,0x5A] => 0x41, # A-Z
1068
+ 0x5B => 0x5B, # [
1069
+ 0x5C => 0x201C, # ``
1070
+ [0x5D,0x5E] => 0x5D, # ], ^
1071
+ 0x5E => 0x2C6, # \hat
1072
+ 0x5F => 0x2D9, # \dot
1073
+ 0x60 => 0x2018, # `
1074
+ [0x61,0x7A] => 0x61, # a-z
1075
+ [0x7B,0x7C] => 0x2013, # \endash, \emdash
1076
+ 0x7B => [0x5F,0,-350], # underline
1077
+ 0x7D => 0x2DD, # double acute
1078
+ 0x7E => [0x7E,0,-350], # ~
1079
+ 0x7E => 0x2DC, # \tilde
1080
+ 0x7F => 0xA8, # \ddot
1081
+ ],
1082
+ };
1083
+
1084
+ $map{cmssbx10} = {
1085
+ "SansSerif-Bold" => [
1086
+ [0,1] => 0x393, # \Gamma, \Delta
1087
+ 2 => 0x398, # \Theta
1088
+ 3 => 0x39B, # \Lambda
1089
+ 4 => 0x39E, # \Xi
1090
+ 5 => 0x3A0, # \Pi
1091
+ 6 => 0x3A3, # \Sigma
1092
+ [7,8] => 0x3A5, # \Upsilon, \Phi
1093
+ [9,0xA] => 0x3A8, # \Psi, \Omega
1094
+
1095
+ 0x10 => 0x131, # \i
1096
+ 0x11 => 0x237, # \j
1097
+ 0x13 => 0xB4, # \acute
1098
+ 0x14 => 0x2C7, # \check
1099
+ 0x15 => 0x2D8, # \breve
1100
+ 0x16 => 0x2C9, # \bar
1101
+ 0x17 => [0xB0,-58,0], # \degree
1102
+ 0x17 => 0x02DA, # \r, ring above
1103
+ 0x18 => 0xB8, # \c, cedilla
1104
+
1105
+ [0x21,0x2F] => 0x21, # !, ", #, $, %, &, ', (, ), *, +, comma, -, ., /
1106
+ 0x22 => 0x201D, # "
1107
+ 0x27 => 0x2019, # '
1108
+ [0x30,0x39] => 0x30, # 0-9
1109
+ [0x3A,0x3B] => 0x3A, # :, ;
1110
+ 0x3D => 0x3D, # =
1111
+ [0x3F,0x40] => 0x3F, # ?, @
1112
+ [0x41,0x5A] => 0x41, # A-Z
1113
+ 0x5B => 0x5B, # [
1114
+ 0x5C => 0x201C, # ``
1115
+ [0x5D,0x5E] => 0x5D, # ], ^
1116
+ 0x5E => 0x2C6, # \hat
1117
+ 0x5F => 0x2D9, # \dot
1118
+ 0x60 => 0x2018, # `
1119
+ [0x61,0x7A] => 0x61, # a-z
1120
+ [0x7B,0x7C] => 0x2013, # \endash, \emdash
1121
+ 0x7B => [0x5F,0,-350], # underline
1122
+ 0x7D => 0x2DD, # double acute
1123
+ 0x7E => [0x7E,0,-350], # ~
1124
+ 0x7E => 0x2DC, # \tilde
1125
+ 0x7F => 0xA8, # \ddot
1126
+ ],
1127
+ };
1128
+
1129
+ $map{eufm10} = {
1130
+ "Fraktur-Regular" => [
1131
+ [0,7] => 0xE300, # variants
1132
+ 0x12 => 0x2018, # left quote
1133
+ 0x13 => 0x2019, # right quote
1134
+ 0x21 => 0x21, # !
1135
+ [0x26,0x2F] => 0x26, # &, ', (, ), *, +, comma, -, ., /
1136
+ [0x30,0x39] => 0x30, # 0-9
1137
+ [0x3A,0x3B] => 0x3A, # :, ;
1138
+ 0x3D => 0x3D, # =
1139
+ 0x3F => 0x3F, # ?
1140
+ [0x41,0x5A] => 0x41, # A-Z
1141
+ 0x5B => 0x5B, # [
1142
+ [0x5D,0x5E] => 0x5D, # ], ^
1143
+ [0x61,0x7A] => 0x61, # a-z
1144
+ 0x7D => 0x22, # "
1145
+ ],
1146
+ };
1147
+
1148
+ $map{eufb10} = {
1149
+ "Fraktur-Bold" => [
1150
+ [1,5] => 0xE301, # variants
1151
+ [8,9] => 0xE308, # variants
1152
+ 0x12 => 0x2018, # left quote
1153
+ 0x13 => 0x2019, # right quote
1154
+ 0x21 => 0x21, # !
1155
+ [0x26,0x2F] => 0x26, # &, ', (, ), *, +, comma, -, ., /
1156
+ [0x30,0x39] => 0x30, # 0-9
1157
+ [0x3A,0x3B] => 0x3A, # :, ;
1158
+ 0x3D => 0x3D, # =
1159
+ 0x3F => 0x3F, # ?
1160
+ [0x41,0x5A] => 0x41, # A-Z
1161
+ 0x5B => 0x5B, # [
1162
+ [0x5D,0x5E] => 0x5D, # ], ^
1163
+ [0x61,0x7A] => 0x61, # a-z
1164
+ 0x7D => 0x22, # "
1165
+ ],
1166
+ };
1167
+
1168
+ $map{rsfs10} = {
1169
+ "Script-Regular" => [
1170
+ [0x41,0x5A] => 0x41, # A-Z
1171
+ ]
1172
+ };
1173
+
1174
+ #$map{eusm10} = {
1175
+ # "Script-Regular" => [
1176
+ # 0x3C => 0x211C, # \Re
1177
+ # 0x3D => 0x2111, # \Im
1178
+ # 0x40 => 0x2135, # \aleph
1179
+ # [0x41,0x5A] => 0x41, # A-Z
1180
+ # 0x66 => 0x7B, # {
1181
+ # 0x67 => 0x7D, # }
1182
+ # 0x78 => 0xA7, # \S
1183
+ # ],
1184
+ #};
1185
+
1186
+ #$map{eusb10} = {
1187
+ # "Script-Bold" => [
1188
+ # 0x3C => 0x211C, # \Re
1189
+ # 0x3D => 0x2111, # \Im
1190
+ # 0x40 => 0x2135, # \aleph
1191
+ # [0x41,0x5A] => 0x41, # A-Z
1192
+ # 0x66 => 0x7B, # {
1193
+ # 0x67 => 0x7D, # }
1194
+ # 0x78 => 0xA7, # \S
1195
+ # ],
1196
+ #};
1197
+
1198
+ $map{cmtt10} = {
1199
+ "Typewriter" => [
1200
+ [0,1] => 0x393, # \Gamma, \Delta
1201
+ 2 => 0x398, # \Theta
1202
+ 3 => 0x39B, # \Lambda
1203
+ 4 => 0x39E, # \Xi
1204
+ 5 => 0x3A0, # \Pi
1205
+ 6 => 0x3A3, # \Sigma
1206
+ [7,8] => 0x3A5, # \Upsilon, \Phi
1207
+ [9,0xA] => 0x3A8, # \Psi, \Omega
1208
+ 0xD => 0x2032, # '
1209
+
1210
+ 0x10 => 0x131, # \i
1211
+ 0x11 => 0x237, # \j
1212
+ 0x12 => 0x2CB, # \grave
1213
+ 0x13 => 0x2CA, # \acute
1214
+ 0x14 => 0x2C7, # \check
1215
+ 0x15 => 0x2D8, # \breve
1216
+ 0x16 => 0x2C9, # \bar
1217
+ 0x17 => 0xB0, # \degree
1218
+ 0x17 => 0x02DA, # \r, ring above
1219
+ 0x18 => 0xB8, # \c, cedilla
1220
+ 0x20 => 0x2423, # graphic representation of space
1221
+
1222
+ [0x21,0x7F] => 0x21,
1223
+
1224
+ 0x60 => 0x2018, # left quote
1225
+ 0x27 => 0x2019, # right quote
1226
+ 0x5E => 0x2C6, # \hat
1227
+ 0x5F => 0x2D9, # \dot
1228
+ 0x7D => 0x2DD, # double acute
1229
+ 0x7E => [0x7E,0,-350], # ~
1230
+ 0x7E => 0x2DC, # \tilde
1231
+ 0x7F => 0xA8, # \ddot
1232
+ ]
1233
+ };
1234
+
1235
+ #########################################################################
1236
+
1237
+ $extra{'Main-Regular'} = {
1238
+ cdots => [
1239
+ 'Select(0u22C5)','Copy()',
1240
+ 'Select(0u22EF)','Paste()',
1241
+ 'PasteWithOffset(447,0)',
1242
+ 'PasteWithOffset(894,0)',
1243
+ 'SetRBearing(894,1)',
1244
+ ],
1245
+
1246
+ ldots => [
1247
+ 'Select(0u2E)','Copy()',
1248
+ 'Select(0u2026)','Paste()',
1249
+ 'PasteWithOffset(447,0)',
1250
+ 'PasteWithOffset(894,0)',
1251
+ 'SetRBearing(894,1)',
1252
+ ],
1253
+
1254
+ vdots => [
1255
+ 'Select(0u2E)','Copy()',
1256
+ 'Select(0u22EE)','Clear()',
1257
+ 'PasteWithOffset(0,-30)',
1258
+ 'PasteWithOffset(0,380)',
1259
+ 'PasteWithOffset(0,780)',
1260
+ 'SetRBearing(-722,1)',
1261
+ ],
1262
+
1263
+ ddots => [
1264
+ 'Select(0u2E)','Copy()',
1265
+ 'Select(0u22F1)','Clear()',
1266
+ 'PasteWithOffset(55,700)',
1267
+ 'PasteWithOffset(502,400)',
1268
+ 'PasteWithOffset(949,100)',
1269
+ 'SetRBearing(282,1)',
1270
+ ],
1271
+
1272
+ spaceEn => [
1273
+ 'Select(0u2002)',
1274
+ 'SetRBearing(500)',
1275
+ ],
1276
+
1277
+ spaceEm => [
1278
+ 'Select(0u2003)',
1279
+ 'SetRBearing(999)',
1280
+ ],
1281
+
1282
+ space3 => [
1283
+ 'Select(0u2004)',
1284
+ 'SetRBearing(333)',
1285
+ ],
1286
+
1287
+ space4 => [
1288
+ 'Select(0u2005)',
1289
+ 'SetRBearing(250)',
1290
+ ],
1291
+
1292
+ space6 => [
1293
+ 'Select(0u2006)',
1294
+ 'SetRBearing(167)',
1295
+ ],
1296
+
1297
+ thinspace => [
1298
+ 'Select(0u2009)',
1299
+ 'SetRBearing(167)',
1300
+ ],
1301
+
1302
+ hairspace => [
1303
+ 'Select(0u200A)',
1304
+ 'SetRBearing(83)',
1305
+ ],
1306
+
1307
+ cong => [
1308
+ 'Select(0u223C)','Copy()',
1309
+ 'Select(0u2245)','Clear()',
1310
+ 'PasteWithOffset(0,222)',
1311
+ 'Select(0u3D)','Copy()',
1312
+ 'Select(0u2245)',
1313
+ 'PasteWithOffset(0,-111)',
1314
+ ],
1315
+
1316
+ bowtie => [
1317
+ 'Select(0u25B9)','Copy()',
1318
+ 'Select(0u22C8)','Paste()',
1319
+ 'Select(0u25C3)','Copy()',
1320
+ 'Select(0u22C8)',
1321
+ 'PasteWithOffset(400,0)',
1322
+ 'SetRBearing(400,1)',
1323
+ 'RemoveOverlap()',
1324
+ ],
1325
+
1326
+ models => [
1327
+ 'Select(0u2223)','Copy()',
1328
+ 'Select(0u22A8)','Paste()',
1329
+ 'Select(0u3D)','Copy()',
1330
+ 'Select(0u22A8)',
1331
+ 'PasteWithOffset(89,0)',
1332
+ 'SetRBearing(589,1)',
1333
+ 'RemoveOverlap()',
1334
+ ],
1335
+
1336
+ doteq => [
1337
+ 'Select(0u3D)','Copy()',
1338
+ 'Select(0u2250)','Paste()',
1339
+ 'Select(0u2E)','Copy()',
1340
+ 'Select(0u2250)',
1341
+ 'PasteWithOffset(251,550)',
1342
+ ],
1343
+
1344
+ not => [
1345
+ 'Select(0uE020)',
1346
+ 'SetRBearing(778,1)',
1347
+ ],
1348
+
1349
+ #notin => [
1350
+ # 'Select(0u2208)','Copy()',
1351
+ # 'Select(0u2209)','Paste()',
1352
+ # 'Select(0u338)','Copy()',
1353
+ # 'Select(0u2209)',
1354
+ # 'PasteWithOffset(-55,0)',
1355
+ # 'RemoveOverlap()',
1356
+ #],
1357
+
1358
+ #noteq => [
1359
+ # 'Select(0u3D)','Copy()',
1360
+ # 'Select(0u2260)','Paste()',
1361
+ # 'Select(0u338)','Copy()',
1362
+ # 'Select(0u2260)',
1363
+ # 'PasteWithOffset(0,0)',
1364
+ # 'RemoveOverlap()',
1365
+ #],
1366
+
1367
+ longleftarrow => [
1368
+ 'Select(0u2190)','Copy()',
1369
+ 'Select(0u27F5)','Paste()',
1370
+ 'Select(0u2212)','Copy()',
1371
+ 'Select(0u27F5)',
1372
+ 'PasteWithOffset(831,0)',
1373
+ 'SetRBearing(609,1)',
1374
+ 'RemoveOverlap()','Simplify()',
1375
+ ],
1376
+
1377
+ Longleftarrow => [
1378
+ 'Select(0u21D0)','Copy()',
1379
+ 'Select(0u27F8)','Paste()',
1380
+ 'Select(0u3D)','Copy()',
1381
+ 'Select(0u27F8)',
1382
+ 'PasteWithOffset(831,0)',
1383
+ 'SetRBearing(609,1)',
1384
+ 'RemoveOverlap()','Simplify()',
1385
+ ],
1386
+
1387
+ longrightarrow => [
1388
+ 'Select(0u2212)','Copy()',
1389
+ 'Select(0u27F6)','Paste()',
1390
+ 'Select(0u2192)','Copy()',
1391
+ 'Select(0u27F6)',
1392
+ 'PasteWithOffset(609,0)',
1393
+ 'SetRBearing(860,1)',
1394
+ 'RemoveOverlap()','Simplify()',
1395
+ ],
1396
+
1397
+ Longrightarrow => [
1398
+ 'Select(0u3D)','Copy()',
1399
+ 'Select(0u27F9)','Paste()',
1400
+ 'Select(0u21D2)','Copy()',
1401
+ 'Select(0u27F9)',
1402
+ 'PasteWithOffset(638,0)',
1403
+ 'SetRBearing(860,1)',
1404
+ 'RemoveOverlap()','Simplify()',
1405
+ ],
1406
+
1407
+ leftrightarrow => [
1408
+ 'Select(0u2190)','Copy()',
1409
+ 'Select(0u27F7)','Paste()',
1410
+ 'Select(0u2192)','Copy()',
1411
+ 'Select(0u27F7)',
1412
+ 'PasteWithOffset(859,0)',
1413
+ 'SetRBearing(859,1)',
1414
+ 'RemoveOverlap()','Simplify()',
1415
+ ],
1416
+
1417
+ Leftrightarrow => [
1418
+ 'Select(0u21D0)','Copy()',
1419
+ 'Select(0u27FA)','Paste()',
1420
+ 'Select(0u21D2)','Copy()',
1421
+ 'Select(0u27FA)',
1422
+ 'PasteWithOffset(858,0)',
1423
+ 'SetRBearing(858,1)',
1424
+ 'RemoveOverlap()','Simplify()',
1425
+ ],
1426
+
1427
+ mapsto => [
1428
+ 'Select(0u2192)','Copy()',
1429
+ 'Select(0u21A6)','Paste()',
1430
+ 'Generate("otf/KaTeX_Main-Regular.otf")',
1431
+ 'Open("pfa/cmsy10.pfa")',
1432
+ 'Select(0x37)','Copy()',
1433
+ 'Open("otf/KaTeX_Main-Regular.otf")',
1434
+ 'Select(0u21A6)',
1435
+ 'PasteWithOffset(0,0)',
1436
+ 'RemoveOverlap()','Simplify()',
1437
+ ],
1438
+
1439
+ xlongmapsto => [
1440
+ 'Select(0u27F6)','Copy()',
1441
+ 'Select(0u27FC)','Paste()',
1442
+ 'Generate("otf/KaTeX_Main-Regular.otf")',
1443
+ 'Open("pfa/cmsy10.pfa")',
1444
+ 'Select(0x37)','Copy()',
1445
+ 'Open("otf/KaTeX_Main-Regular.otf")',
1446
+ 'Select(0u27FC)',
1447
+ 'PasteWithOffset(0,0)',
1448
+ 'RemoveOverlap()','Simplify()',
1449
+ ],
1450
+
1451
+ hookleftarrow => [
1452
+ 'Select(0u2190)','Copy()',
1453
+ 'Select(0u21A9)','Paste()',
1454
+ 'Generate("otf/KaTeX_Main-Regular.otf")',
1455
+ 'Open("pfa/cmmi10.pfa")',
1456
+ 'Select(0x2D)','Copy()',
1457
+ 'Open("otf/KaTeX_Main-Regular.otf")',
1458
+ 'Select(0u21A9)',
1459
+ 'PasteWithOffset(848,0)',
1460
+ 'SetRBearing(126,1)',
1461
+ 'RemoveOverlap()','Simplify()',
1462
+ ],
1463
+
1464
+ hookrightarrow => [
1465
+ 'Generate("otf/KaTeX_Main-Regular.otf")',
1466
+ 'Open("pfa/cmmi10.pfa")',
1467
+ 'Select(0x2C)','Copy()',
1468
+ 'Open("otf/KaTeX_Main-Regular.otf")',
1469
+ 'Select(0u21AA)','Paste()',
1470
+ 'Select(0u2192)','Copy()',
1471
+ 'Select(0u21AA)',
1472
+ 'PasteWithOffset(126,0)',
1473
+ 'SetRBearing(848,1)',
1474
+ 'RemoveOverlap()','Simplify()',
1475
+ ],
1476
+
1477
+ rightleftharpoons => [
1478
+ 'Select(0u21BD)','Copy()',
1479
+ 'Select(0u21CC)','Paste()',
1480
+ 'Select(0u21C0)','Copy()',
1481
+ 'Select(0u21CC)',
1482
+ 'PasteWithOffset(0,160)',
1483
+ 'RemoveOverlap()','Simplify()',
1484
+ ],
1485
+
1486
+ lgroup => [
1487
+ 'Select(0u23B0)','Copy()',
1488
+ 'Select(0u27EE)','Paste()',
1489
+ 'Select(0u23A9)','Copy()',
1490
+ 'Select(0u27EE)',
1491
+ 'PasteWithOffset(0,0)',
1492
+ 'Scale(55,0,0)','RoundToInt()','Move(-38,250)',
1493
+ 'RemoveOverlap()','Simplify()',
1494
+ 'SetRBearing(-38,1)',
1495
+ ],
1496
+
1497
+ rgroup => [
1498
+ 'Select(0u23B1)','Copy()',
1499
+ 'Select(0u27EF)','Paste()',
1500
+ 'Select(0u23AD)','Copy()',
1501
+ 'Select(0u27EF)',
1502
+ 'PasteWithOffset(1,0)',
1503
+ 'Scale(55,0,0)','RoundToInt()','Move(-38,250)',
1504
+ 'RemoveOverlap()','Simplify()',
1505
+ 'SetRBearing(-38,1)',
1506
+ ],
1507
+
1508
+ lmoustache => [
1509
+ 'Select(0u23AD)','Copy()',
1510
+ 'Select(0u23B0)',
1511
+ 'PasteWithOffset(0,0)',
1512
+ 'Scale(55,0,0)','RoundToInt()','Move(-38,250)',
1513
+ 'RemoveOverlap()','Simplify()',
1514
+ 'SetRBearing(-38,1)',
1515
+ ],
1516
+
1517
+ rmoustache => [
1518
+ 'Select(0u23A9)','Copy()',
1519
+ 'Select(0u23B1)',
1520
+ 'PasteWithOffset(0,0)',
1521
+ 'Scale(55,0,0)','RoundToInt()','Move(-38,250)',
1522
+ 'RemoveOverlap()','Simplify()',
1523
+ 'SetRBearing(-38,1)',
1524
+ ],
1525
+
1526
+ diacriticals => [
1527
+ 'Select(0uB0)', 'SetRBearing(-125,1)', # \degree
1528
+ 'Select(0u20D7)','SetRBearing(153,1)', # \vec
1529
+ ],
1530
+
1531
+ };
1532
+
1533
+ $extra{'Main-Bold'} = {
1534
+ cdots => [
1535
+ 'Select(0u22C5)','Copy()',
1536
+ 'Select(0u22EF)','Paste()',
1537
+ 'PasteWithOffset(488,0)',
1538
+ 'PasteWithOffset(976,0)',
1539
+ 'SetRBearing(976,1)',
1540
+ ],
1541
+
1542
+ ldots => [
1543
+ 'Select(0u2E)','Copy()',
1544
+ 'Select(0u2026)','Paste()',
1545
+ 'PasteWithOffset(488,0)',
1546
+ 'PasteWithOffset(976,0)',
1547
+ 'SetRBearing(976,1)',
1548
+ ],
1549
+
1550
+ vdots => [
1551
+ 'Select(0u2E)','Copy()',
1552
+ 'Select(0u22EE)','Clear()',
1553
+ 'PasteWithOffset(0,-30)',
1554
+ 'PasteWithOffset(0,380)',
1555
+ 'PasteWithOffset(0,780)',
1556
+ 'SetRBearing(-681,1)',
1557
+ ],
1558
+
1559
+ ddots => [
1560
+ 'Select(0u2E)','Copy()',
1561
+ 'Select(0u22F1)','Clear()',
1562
+ 'PasteWithOffset(55,700)',
1563
+ 'PasteWithOffset(502,400)',
1564
+ 'PasteWithOffset(949,100)',
1565
+ 'SetRBearing(323,1)',
1566
+ ],
1567
+
1568
+ spaceEn => [
1569
+ 'Select(0u2002)',
1570
+ 'SetRBearing(500)',
1571
+ ],
1572
+
1573
+ spaceEm => [
1574
+ 'Select(0u2003)',
1575
+ 'SetRBearing(999)',
1576
+ ],
1577
+
1578
+ space3 => [
1579
+ 'Select(0u2004)',
1580
+ 'SetRBearing(333)',
1581
+ ],
1582
+
1583
+ space4 => [
1584
+ 'Select(0u2005)',
1585
+ 'SetRBearing(250)',
1586
+ ],
1587
+
1588
+ space6 => [
1589
+ 'Select(0u2006)',
1590
+ 'SetRBearing(167)',
1591
+ ],
1592
+
1593
+ thinspace => [
1594
+ 'Select(0u2009)',
1595
+ 'SetRBearing(167)',
1596
+ ],
1597
+
1598
+ hairspace => [
1599
+ 'Select(0u200A)',
1600
+ 'SetRBearing(83)',
1601
+ ],
1602
+
1603
+ cong => [
1604
+ 'Select(0u223C)','Copy()',
1605
+ 'Select(0u2245)','Clear()',
1606
+ 'PasteWithOffset(0,247)',
1607
+ 'Select(0u3D)','Copy()',
1608
+ 'Select(0u2245)',
1609
+ 'PasteWithOffset(0,-136)',
1610
+ ],
1611
+
1612
+ bowtie => [
1613
+ 'Select(0u25B9)','Copy()',
1614
+ 'Select(0u22C8)','Paste()',
1615
+ 'Select(0u25C3)','Copy()',
1616
+ 'Select(0u22C8)',
1617
+ 'PasteWithOffset(425,0)',
1618
+ 'SetRBearing(425,1)',
1619
+ 'RemoveOverlap()',
1620
+ ],
1621
+
1622
+ models => [
1623
+ 'Select(0u2223)','Copy()',
1624
+ 'Select(0u22A8)','Paste()',
1625
+ 'Select(0u3D)','Copy()',
1626
+ 'Select(0u22A8)',
1627
+ 'PasteWithOffset(89,0)',
1628
+ 'SetRBearing(655,1)',
1629
+ 'RemoveOverlap()',
1630
+ ],
1631
+
1632
+ doteq => [
1633
+ 'Select(0u3D)','Copy()',
1634
+ 'Select(0u2250)','Paste()',
1635
+ 'Select(0u2E)','Copy()',
1636
+ 'Select(0u2250)',
1637
+ 'PasteWithOffset(288,550)',
1638
+ ],
1639
+
1640
+ not => [
1641
+ 'Select(0uE020)',
1642
+ 'SetRBearing(894,1)',
1643
+ ],
1644
+
1645
+ # notin => [
1646
+ # 'Select(0u2208)','Copy()',
1647
+ # 'Select(0u2209)','Paste()',
1648
+ # 'Select(0u338)','Copy()',
1649
+ # 'Select(0u2209)',
1650
+ # 'PasteWithOffset(-63,0)',
1651
+ # 'PasteWithOffset(831,0)',
1652
+ # 'RemoveOverlap()',
1653
+ # ],
1654
+
1655
+ # noteq => [
1656
+ # 'Select(0u3D)','Copy()',
1657
+ # 'Select(0u2260)','Paste()',
1658
+ # 'Select(0u338)','Copy()',
1659
+ # 'Select(0u2260)',
1660
+ # 'PasteWithOffset(0,0)',
1661
+ # 'PasteWithOffset(894,0)',
1662
+ # 'RemoveOverlap()',
1663
+ # ],
1664
+
1665
+ longleftarrow => [
1666
+ 'Select(0u2190)','Copy()',
1667
+ 'Select(0u27F5)','Paste()',
1668
+ 'Select(0u2212)','Copy()',
1669
+ 'Select(0u27F5)',
1670
+ 'PasteWithOffset(944,0)',
1671
+ 'SetRBearing(655,1)',
1672
+ 'RemoveOverlap()','Simplify()',
1673
+ ],
1674
+
1675
+ Longleftarrow => [
1676
+ 'Select(0u21D0)','Copy()',
1677
+ 'Select(0u27F8)','Paste()',
1678
+ 'Select(0u3D)','Copy()',
1679
+ 'Select(0u27F8)',
1680
+ 'PasteWithOffset(975,0)',
1681
+ 'SetRBearing(718,1)',
1682
+ 'RemoveOverlap()','Simplify()',
1683
+ ],
1684
+
1685
+ longrightarrow => [
1686
+ 'Select(0u2212)','Copy()',
1687
+ 'Select(0u27F6)','Paste()',
1688
+ 'Select(0u2192)','Copy()',
1689
+ 'Select(0u27F6)',
1690
+ 'PasteWithOffset(688,0)',
1691
+ 'SetRBearing(939,1)',
1692
+ 'RemoveOverlap()','Simplify()',
1693
+ ],
1694
+
1695
+ Longrightarrow => [
1696
+ 'Select(0u3D)','Copy()',
1697
+ 'Select(0u27F9)','Paste()',
1698
+ 'Select(0u21D2)','Copy()',
1699
+ 'Select(0u27F9)',
1700
+ 'PasteWithOffset(720,0)',
1701
+ 'SetRBearing(976,1)',
1702
+ 'RemoveOverlap()','Simplify()',
1703
+ ],
1704
+
1705
+ leftrightarrow => [
1706
+ 'Select(0u2190)','Copy()',
1707
+ 'Select(0u27F7)','Paste()',
1708
+ 'Select(0u2192)','Copy()',
1709
+ 'Select(0u27F7)',
1710
+ 'PasteWithOffset(976,0)',
1711
+ 'SetRBearing(976,1)',
1712
+ 'RemoveOverlap()','Simplify()',
1713
+ ],
1714
+
1715
+ Leftrightarrow => [
1716
+ 'Select(0u21D0)','Copy()',
1717
+ 'Select(0u27FA)','Paste()',
1718
+ 'Select(0u21D2)','Copy()',
1719
+ 'Select(0u27FA)',
1720
+ 'PasteWithOffset(976,0)',
1721
+ 'SetRBearing(976,1)',
1722
+ 'RemoveOverlap()','Simplify()',
1723
+ ],
1724
+
1725
+ mapsto => [
1726
+ 'Select(0u2192)','Copy()',
1727
+ 'Select(0u21A6)','Paste()',
1728
+ 'Generate("otf/KaTeX_Main-Bold.otf")',
1729
+ 'Open("pfa/cmbsy10.pfa")',
1730
+ 'Select(0x37)','Copy()',
1731
+ 'Open("otf/KaTeX_Main-Bold.otf")',
1732
+ 'Select(0u21A6)',
1733
+ 'PasteWithOffset(0,0)',
1734
+ 'RemoveOverlap()','Simplify()',
1735
+ ],
1736
+
1737
+ xlongmapsto => [
1738
+ 'Select(0u27F6)','Copy()',
1739
+ 'Select(0u27FC)','Paste()',
1740
+ 'Generate("otf/KaTeX_Main-Bold.otf")',
1741
+ 'Open("pfa/cmbsy10.pfa")',
1742
+ 'Select(0x37)','Copy()',
1743
+ 'Open("otf/KaTeX_Main-Bold.otf")',
1744
+ 'Select(0u27FC)',
1745
+ 'PasteWithOffset(0,0)',
1746
+ 'RemoveOverlap()','Simplify()',
1747
+ ],
1748
+
1749
+ hookleftarrow => [
1750
+ 'Select(0u2190)','Copy()',
1751
+ 'Select(0u21A9)','Paste()',
1752
+ 'Generate("otf/KaTeX_Main-Bold.otf")',
1753
+ 'Open("pfa/cmmib10.pfa")',
1754
+ 'Select(0x2D)','Copy()',
1755
+ 'Open("otf/KaTeX_Main-Bold.otf")',
1756
+ 'Select(0u21A9)',
1757
+ 'PasteWithOffset(965,0)',
1758
+ 'SetRBearing(132,1)',
1759
+ 'RemoveOverlap()','Simplify()',
1760
+ ],
1761
+
1762
+ hookrightarrow => [
1763
+ 'Generate("otf/KaTeX_Main-Bold.otf")',
1764
+ 'Open("pfa/cmmib10.pfa")',
1765
+ 'Select(0x2C)','Copy()',
1766
+ 'Open("otf/KaTeX_Main-Bold.otf")',
1767
+ 'Select(0u21AA)','Paste()',
1768
+ 'Select(0u2192)','Copy()',
1769
+ 'Select(0u21AA)',
1770
+ 'PasteWithOffset(132,0)',
1771
+ 'SetRBearing(963,1)',
1772
+ 'RemoveOverlap()','Simplify()',
1773
+ ],
1774
+
1775
+ rightleftharpoons => [
1776
+ 'Select(0u21BD)','Copy()',
1777
+ 'Select(0u21CC)','Paste()',
1778
+ 'Select(0u21C0)','Copy()',
1779
+ 'Select(0u21CC)',
1780
+ 'PasteWithOffset(0,200)',
1781
+ 'RemoveOverlap()','Simplify()',
1782
+ ],
1783
+
1784
+ hbar => [
1785
+ 'Select(0u2C9)','Copy()',
1786
+ 'Select(0u210F)','PasteWithOffset(0,0)',
1787
+ 'RemoveOverlap()','Simplify()',
1788
+ ],
1789
+
1790
+ angle => [
1791
+ 'Select(0u2220)','Copy()',
1792
+ 'PasteWithOffset(0,10)',
1793
+ 'PasteWithOffset(0,20)',
1794
+ 'RemoveOverlap()','Simplify()',
1795
+ 'PasteWithOffset(10,0)',
1796
+ 'RemoveOverlap()','Simplify()',
1797
+ ],
1798
+
1799
+ diacriticals => [
1800
+ 'Select(0uB0)', 'SetRBearing(-147,1)', # \degree
1801
+ 'Select(0u20D7)','SetRBearing(154,1)', # \vec
1802
+ ],
1803
+ };
1804
+
1805
+ $extra{'Main-Italic'} = {
1806
+ diacriticals => [
1807
+ 'Select(0uB0)', 'SetRBearing(-160,1)', # \degree
1808
+ ],
1809
+ };
1810
+
1811
+ $extra{'Size1'} = {
1812
+ iint => [
1813
+ 'Select(0u222B)', 'Copy()',
1814
+ 'Select(0u222C)', 'Paste()',
1815
+ 'PasteWithOffset(347,0)',
1816
+ 'SetRBearing(347,1)',
1817
+ ],
1818
+
1819
+ iiint => [
1820
+ 'Select(0u222B)', 'Copy()',
1821
+ 'Select(0u222D)', 'Paste()',
1822
+ 'PasteWithOffset(347,0)',
1823
+ 'PasteWithOffset(694,0)',
1824
+ 'SetRBearing(694,1)',
1825
+ ],
1826
+ };
1827
+
1828
+ $extra{'Size2'} = {
1829
+ iint => [
1830
+ 'Select(0u222B)', 'Copy()',
1831
+ 'Select(0u222C)', 'Paste()',
1832
+ 'PasteWithOffset(528,0)',
1833
+ 'SetRBearing(528,1)',
1834
+ ],
1835
+
1836
+ iiint => [
1837
+ 'Select(0u222B)', 'Copy()',
1838
+ 'Select(0u222D)', 'Paste()',
1839
+ 'PasteWithOffset(528,0)',
1840
+ 'PasteWithOffset(1036,0)',
1841
+ 'SetRBearing(1036,1)',
1842
+ ],
1843
+ };
1844
+
1845
+ $extra{'Size4'} = {
1846
+ braceext => [
1847
+ 'Open("lib/Extra.otf")',
1848
+ 'Select(0u5F)','Copy()',
1849
+ 'Open("otf/KaTeX_Size4-Regular.otf")',
1850
+ 'Select(0uE154)','Paste()',
1851
+ ],
1852
+ };
1853
+
1854
+ $extra{"AMS"} = {
1855
+ dashleftarrow => [
1856
+ 'Select(0u2190)', 'Copy()',
1857
+ 'Select(0u21E0)', 'Paste()',
1858
+ 'Select(0u2212)','Copy()',
1859
+ 'Select(0u21E0)',
1860
+ 'PasteWithOffset(417,0)',
1861
+ 'PasteWithOffset(834,0)',
1862
+ 'SetRBearing(834,1)',
1863
+ ],
1864
+
1865
+ dashrightarrow => [
1866
+ 'Select(0u2212)', 'Copy()',
1867
+ 'Select(0u21E2)', 'Paste()',
1868
+ 'PasteWithOffset(417,0)',
1869
+ 'Select(0u2192)','Copy()',
1870
+ 'Select(0u21E2)','PasteWithOffset(834,0)',
1871
+ 'SetRBearing(834,1)',
1872
+ ],
1873
+ };
1874
+
1875
+ $extra{'Typewriter'} = {
1876
+ space => [
1877
+ 'Select(0u20)','Clear()',
1878
+ 'SetRBearing(525)',
1879
+ ],
1880
+
1881
+ spaceNB => [
1882
+ 'Select(0uA0)','Clear()',
1883
+ 'SetRBearing(525)',
1884
+ ],
1885
+ };
1886
+
1887
+ $extra{"SansSerif-Regular"} = {
1888
+ diacriticals => [
1889
+ 'Select(0uB0)', 'SetRBearing(-142,1)', # \degree
1890
+ ],
1891
+ };
1892
+
1893
+ $extra{"SansSerif-Italic"} = {
1894
+ diacriticals => [
1895
+ 'Select(0uB0)', 'SetRBearing(-113,1)', # \degree
1896
+ ],
1897
+ };
1898
+
1899
+ $extra{"SansSerif-Bold"} = {
1900
+ diacriticals => [
1901
+ 'Select(0uB0)', 'SetRBearing(-58,1)', # \degree
1902
+ ],
1903
+ };
1904
+
1905
+ #########################################################################
1906
+
1907
+ foreach $cmfont (sort (keys %map)) {
1908
+ print "Reading $cmfont...\n";
1909
+ foreach $mjfont (keys %{$map{$cmfont}}) {
1910
+ $fontname = "KaTeX_$mjfont";
1911
+ $style = $fontname; $style =~ s/.*?(-|$)//; $style = "Regular" unless $style;
1912
+ $normal = "Normal"; $normal = "Bold" if style =~ m/Bold/;
1913
+ $family = $fontname; $family =~ s/-.*//;
1914
+ $fontname = "$family-$style";
1915
+ $STYLE = $style; $STYLE = "Bold Italic" if $STYLE eq "BoldItalic";
1916
+ $otf = "otf/$fontname.otf";
1917
+ unless (defined($script{$mjfont})) {
1918
+ open(SPACE,"lib/Space.ttx"); $lines = join("",<SPACE>); close(SPACE);
1919
+ $lines =~ s/\*NAME\*/$family/g; $lines =~ s/\*WEIGHT\*/$style/g;
1920
+ $lines =~ s/\*WEIGHT_S\*/$STYLE/g; $lines =~ s/\*NORMAL\*/$normal/g;
1921
+ if ($style eq "Regular") {$lines =~ s/\* WEIGHT\*//g} else {$lines =~ s/\* WEIGHT\*/ $STYLE/g}
1922
+ open(SPACE,">Space.ttx"); print SPACE $lines; close(SPACE);
1923
+ `$TTX -f Space.ttx; mv Space.otf '$otf'`; unlink("Space.ttx");
1924
+ $script{$mjfont} = [
1925
+ 'Open("'.$otf.'")',
1926
+ 'SetPanose([0,0,'.($style eq 'Bold' ? '8' : '0').',0,0,0,0,0,0,0])',
1927
+ 'SetOS2Value("Weight",'.($style =~ m/Bold/ ? 700 : 400).')',
1928
+ 'SetGasp(8,2,16,1,65535,3)',
1929
+ 'Reencode("unicode")',
1930
+ 'Generate("'.$otf.'")',
1931
+ ];
1932
+ }
1933
+ $script = $script{$mjfont};
1934
+ @remap = @{$map{$cmfont}{$mjfont}};
1935
+ while (defined($item = shift(@remap))) {
1936
+ $remap = shift(@remap);
1937
+ if ($cmfont =~ /^eu/) {
1938
+ push(@$script,'Open("pfa/'.$cmfont.'.pfb")');
1939
+ } else {
1940
+ push(@$script,'Open("pfa/'.$cmfont.'.pfa")');
1941
+ }
1942
+ if (ref($item) eq "ARRAY") {
1943
+ push(@$script,'Select('.sprintf("%d,%d",@$item).')');
1944
+ } else {
1945
+ push(@$script,'Select('.$item.')');
1946
+ }
1947
+ push(@$script,"Copy()",'Open("'.$otf.'")');
1948
+ if (ref($item) eq "ARRAY") {
1949
+ push(@$script,
1950
+ 'Select('.sprintf("0u%04x,0u%04x",$remap,$remap+($item->[1]-$item->[0])).')',
1951
+ 'Paste()',
1952
+ );
1953
+ } elsif (ref($remap) eq "ARRAY") {
1954
+ push(@$script,
1955
+ 'Select('.sprintf("0u%04x",$remap->[0]).')',
1956
+ 'Paste()',
1957
+ 'Move('.$remap->[1].','.$remap->[2].')',
1958
+ );
1959
+ } else {
1960
+ push(@$script,'Select('.sprintf("0u%04x",$remap).')','Paste()');
1961
+ }
1962
+ push(@$script,'Generate("'.$otf.'")');
1963
+ }
1964
+ }
1965
+ }
1966
+ print "\n";
1967
+
1968
+
1969
+ #
1970
+ # Add extra characters by hand
1971
+ #
1972
+ foreach $font (keys %extra) {
1973
+ foreach $char (sort(keys %{$extra{$font}})) {
1974
+ push(@{$script{$font}},join(";\n",@{$extra{$font}{$char}}),"");
1975
+ }
1976
+ }
1977
+
1978
+ # Cleanup temporary glyphs
1979
+ push(@{$script{'Main-Regular'}},
1980
+ 'Select(0u23A9)',
1981
+ 'Clear()',
1982
+ 'Select(0u23AD)',
1983
+ 'Clear()',
1984
+ );
1985
+
1986
+ #
1987
+ # Write all scripts
1988
+ #
1989
+ foreach $font (sort keys %script) {
1990
+ $family = $font; $family .= "-Regular" unless $family =~ m/-/;
1991
+ print "KaTeX_$font\n";
1992
+ open(SCRIPT,">","ff/KaTeX_$family.ff");
1993
+ print SCRIPT join(";\n",@{$script{$font}},"",
1994
+ 'SelectAll()','RoundToInt()',
1995
+ 'Simplify()','AddExtrema()','Simplify()',
1996
+ 'ClearHints()','AutoHint()','RoundToInt()',
1997
+ 'Generate("otf/KaTeX_'.$family.'.otf")',
1998
+ 'SelectAll()','AutoInstr()',
1999
+ 'Generate("ttf/KaTeX_'.$family.'.ttf")'),"\n";
2000
+ close(SCRIPT);
2001
+ }
2002
+
2003
+ 1;