1 // Copyright (C) 2000-2007, Luca Padovani <padovani@sti.uniurb.it>.
2 //
3 // This file is part of GtkMathView, a flexible, high-quality rendering
4 // engine for MathML documents.
5 //
6 // GtkMathView is free software; you can redistribute it and/or modify it
7 // under the terms of the GNU Lesser General Public License as published
8 // by the Free Software Foundation; either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // GtkMathView is distributed in the hope that it will be useful, but
12 // WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public License
17 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18
19 #include "TFM.hh"
20
21 static TFM::Font font = {
22 "CMSY",
23
24 0xf0,
25 "TeX math symbols",
26 0x00700000,
27 0x4f21e285,
28 22,
29 128
30 };
31
32 static TFM::Dimension dimension[] = {
33 { 0x01, "slant", 0x00040000 },
34 { 0x02, "space", 0x00000000 },
35 { 0x03, "space_stretch", 0x00000000 },
36 { 0x04, "space_shrink", 0x00000000 },
37 { 0x05, "x_height", 0x0006e38e },
38 { 0x06, "quad", 0x0012baf2 },
39 { 0x07, "extra_space", 0x00000000 },
40 { 0x08, "num1", 0x000bb78e },
41 { 0x09, "num2", 0x00062477 },
42 { 0x0a, "num3", 0x00078a0e },
43 { 0x0b, "denom1", 0x000c08ce },
44 { 0x0c, "denom2", 0x000581e7 },
45 { 0x0d, "sup1", 0x00080a6b },
46 { 0x0e, "sup2", 0x0006e5d9 },
47 { 0x0f, "sup3", 0x00049249 },
48 { 0x10, "sub1", 0x00024925 },
49 { 0x11, "sub2", 0x00049249 },
50 { 0x12, "supdrop", 0x0005a697 },
51 { 0x13, "subdrop", 0x00012492 },
52 { 0x14, "delim1", 0x001b3332 },
53 { 0x15, "delim2", 0x001283a9 },
54 { 0x16, "axis_height", 0x00040000 }
55 };
56
57
58 static TFM::Kerning C_41_Kerning[] = {
59 { 0x30, 0x000371d0 }
60 };
61
62 static TFM::Kerning C_42_Kerning[] = {
63 { 0x30, 0x000275de }
64 };
65
66 static TFM::Kerning C_43_Kerning[] = {
67 { 0x30, 0x000275de }
68 };
69
70 static TFM::Kerning C_44_Kerning[] = {
71 { 0x30, 0x000179eb }
72 };
73
74 static TFM::Kerning C_45_Kerning[] = {
75 { 0x30, 0x0001f7e5 }
76 };
77
78 static TFM::Kerning C_46_Kerning[] = {
79 { 0x30, 0x0001f7e5 }
80 };
81
82 static TFM::Kerning C_47_Kerning[] = {
83 { 0x30, 0x0001f7e5 }
84 };
85
86 static TFM::Kerning C_48_Kerning[] = {
87 { 0x30, 0x0001f7e5 }
88 };
89
90 static TFM::Kerning C_49_Kerning[] = {
91 { 0x30, 0x00007df9 }
92 };
93
94 static TFM::Kerning C_4a_Kerning[] = {
95 { 0x30, 0x0002f3d7 }
96 };
97
98 static TFM::Kerning C_4b_Kerning[] = {
99 { 0x30, 0x0000fbf2 }
100 };
101
102 static TFM::Kerning C_4c_Kerning[] = {
103 { 0x30, 0x000275de }
104 };
105
106 static TFM::Kerning C_4d_Kerning[] = {
107 { 0x30, 0x000275de }
108 };
109
110 static TFM::Kerning C_4e_Kerning[] = {
111 { 0x30, 0x000179eb }
112 };
113
114 static TFM::Kerning C_4f_Kerning[] = {
115 { 0x30, 0x0001f7e5 }
116 };
117
118 static TFM::Kerning C_50_Kerning[] = {
119 { 0x30, 0x000179eb }
120 };
121
122 static TFM::Kerning C_51_Kerning[] = {
123 { 0x30, 0x0001f7e5 }
124 };
125
126 static TFM::Kerning C_52_Kerning[] = {
127 { 0x30, 0x000179eb }
128 };
129
130 static TFM::Kerning C_53_Kerning[] = {
131 { 0x30, 0x000275de }
132 };
133
134 static TFM::Kerning C_54_Kerning[] = {
135 { 0x30, 0x00007df9 }
136 };
137
138 static TFM::Kerning C_55_Kerning[] = {
139 { 0x30, 0x000179eb }
140 };
141
142 static TFM::Kerning C_56_Kerning[] = {
143 { 0x30, 0x00007df9 }
144 };
145
146 static TFM::Kerning C_57_Kerning[] = {
147 { 0x30, 0x000179eb }
148 };
149
150 static TFM::Kerning C_58_Kerning[] = {
151 { 0x30, 0x000275de }
152 };
153
154 static TFM::Kerning C_59_Kerning[] = {
155 { 0x30, 0x000179eb }
156 };
157
158 static TFM::Kerning C_5a_Kerning[] = {
159 { 0x30, 0x000275de }
160 };
161
162
163 static TFM::Character character[] = {
164 { 0x00, 0x000e4929, 0x0009e7a0, 0x0001e7a0, 0x00000000, 0, 0, 0, 0 },
165 { 0x01, 0x00056db9, 0x000771c9, 0xffff71c9, 0x00000000, 0, 0, 0, 0 },
166 { 0x02, 0x000e4929, 0x0009e7a0, 0x0001e7a0, 0x00000000, 0, 0, 0, 0 },
167 { 0x03, 0x00095d79, 0x000771c7, 0xffff71c7, 0x00000000, 0, 0, 0, 0 },
168 { 0x04, 0x000e4929, 0x0009e7a0, 0x0001e7a0, 0x00000000, 0, 0, 0, 0 },
169 { 0x05, 0x00095d79, 0x000771c9, 0xffff71c9, 0x00000000, 0, 0, 0, 0 },
170 { 0x06, 0x000e4929, 0x0009e7a0, 0x0001e7a0, 0x00000000, 0, 0, 0, 0 },
171 { 0x07, 0x000e4929, 0x0009e7a0, 0x0001e7a0, 0x00000000, 0, 0, 0, 0 },
172 { 0x08, 0x000e4929, 0x0009e7a0, 0x0001e7a0, 0x00000000, 0, 0, 0, 0 },
173 { 0x09, 0x000e4929, 0x0009e7a0, 0x0001e7a0, 0x00000000, 0, 0, 0, 0 },
174 { 0x0a, 0x000e4929, 0x0009e7a0, 0x0001e7a0, 0x00000000, 0, 0, 0, 0 },
175 { 0x0b, 0x000e4929, 0x0009e7a0, 0x0001e7a0, 0x00000000, 0, 0, 0, 0 },
176 { 0x0c, 0x000e4929, 0x0009e7a0, 0x0001e7a0, 0x00000000, 0, 0, 0, 0 },
177 { 0x0d, 0x001238e9, 0x000b1c72, 0x00031c72, 0x00000000, 0, 0, 0, 0 },
178 { 0x0e, 0x00095d79, 0x000771c9, 0xffff71c9, 0x00000000, 0, 0, 0, 0 },
179 { 0x0f, 0x00095d79, 0x000771c9, 0xffff71c9, 0x00000000, 0, 0, 0, 0 },
180 { 0x10, 0x000e4929, 0x0007e6e5, 0xffffe6e5, 0x00000000, 0, 0, 0, 0 },
181 { 0x11, 0x000e4929, 0x0007e6e5, 0xffffe6e5, 0x00000000, 0, 0, 0, 0 },
182 { 0x12, 0x000e4929, 0x000af7ae, 0x0002f7ae, 0x00000000, 0, 0, 0, 0 },
183 { 0x13, 0x000e4929, 0x000af7ae, 0x0002f7ae, 0x00000000, 0, 0, 0, 0 },
184 { 0x14, 0x000e4929, 0x000af7ae, 0x0002f7ae, 0x00000000, 0, 0, 0, 0 },
185 { 0x15, 0x000e4929, 0x000af7ae, 0x0002f7ae, 0x00000000, 0, 0, 0, 0 },
186 { 0x16, 0x000e4929, 0x000af7ae, 0x0002f7ae, 0x00000000, 0, 0, 0, 0 },
187 { 0x17, 0x000e4929, 0x000af7ae, 0x0002f7ae, 0x00000000, 0, 0, 0, 0 },
188 { 0x18, 0x000e4929, 0x00062530, 0xfffe2530, 0x00000000, 0, 0, 0, 0 },
189 { 0x19, 0x000e4929, 0x000840d5, 0x000040d5, 0x00000000, 0, 0, 0, 0 },
190 { 0x1a, 0x000e4929, 0x000935f7, 0x000135f7, 0x00000000, 0, 0, 0, 0 },
191 { 0x1b, 0x000e4929, 0x000935f7, 0x000135f7, 0x00000000, 0, 0, 0, 0 },
192 { 0x1c, 0x001238e9, 0x000935f7, 0x000135f7, 0x00000000, 0, 0, 0, 0 },
193 { 0x1d, 0x001238e9, 0x000935f7, 0x000135f7, 0x00000000, 0, 0, 0, 0 },
194 { 0x1e, 0x000e4929, 0x000935f7, 0x000135f7, 0x00000000, 0, 0, 0, 0 },
195 { 0x1f, 0x000e4929, 0x000935f7, 0x000135f7, 0x00000000, 0, 0, 0, 0 },
196 { 0x20, 0x001238e9, 0x00062530, 0xfffe2530, 0x00000000, 0, 0, 0, 0 },
197 { 0x21, 0x001238e9, 0x00062530, 0xfffe2530, 0x00000000, 0, 0, 0, 0 },
198 { 0x22, 0x00095d79, 0x000b1c72, 0x00031c72, 0x00000000, 0, 0, 0, 0 },
199 { 0x23, 0x00095d79, 0x000b1c72, 0x00031c72, 0x00000000, 0, 0, 0, 0 },
200 { 0x24, 0x001238e9, 0x00062530, 0xfffe2530, 0x00000000, 0, 0, 0, 0 },
201 { 0x25, 0x001238e9, 0x000b1c72, 0x00031c72, 0x00000000, 0, 0, 0, 0 },
202 { 0x26, 0x001238e9, 0x000b1c72, 0x00031c72, 0x00000000, 0, 0, 0, 0 },
203 { 0x27, 0x000e4929, 0x0007e6e5, 0xffffe6e5, 0x00000000, 0, 0, 0, 0 },
204 { 0x28, 0x001238e9, 0x00062530, 0xfffe2530, 0x00000000, 0, 0, 0, 0 },
205 { 0x29, 0x001238e9, 0x00062530, 0xfffe2530, 0x00000000, 0, 0, 0, 0 },
206 { 0x2a, 0x000b5559, 0x000b1c72, 0x00031c72, 0x00000000, 0, 0, 0, 0 },
207 { 0x2b, 0x000b5559, 0x000b1c72, 0x00031c72, 0x00000000, 0, 0, 0, 0 },
208 { 0x2c, 0x001238e9, 0x00062530, 0xfffe2530, 0x00000000, 0, 0, 0, 0 },
209 { 0x2d, 0x001238e9, 0x000b1c72, 0x00031c72, 0x00000000, 0, 0, 0, 0 },
210 { 0x2e, 0x001238e9, 0x000b1c72, 0x00031c72, 0x00000000, 0, 0, 0, 0 },
211 { 0x2f, 0x000e4929, 0x0006e38e, 0x00000000, 0x00000000, 0, 0, 0, 0 },
212 { 0x30, 0x00054515, 0x0008e390, 0x00000000, 0x00000000, 0, 0, 0, 0 },
213 { 0x31, 0x001238e9, 0x0006e38e, 0x00000000, 0x00000000, 0, 0, 0, 0 },
214 { 0x32, 0x000c5149, 0x000935f7, 0x000135f7, 0x00000000, 0, 0, 0, 0 },
215 { 0x33, 0x000c5149, 0x000935f7, 0x000135f7, 0x00000000, 0, 0, 0, 0 },
216 { 0x34, 0x00104109, 0x000b1c72, 0x00031c72, 0x00000000, 0, 0, 0, 0 },
217 { 0x35, 0x00104109, 0x000b1c72, 0x00031c72, 0x00000000, 0, 0, 0, 0 },
218 { 0x36, 0x00000000, 0x000b1c72, 0x00031c72, 0x00000000, 0, 0, 0, 0 },
219 { 0x37, 0x00000000, 0x00062530, 0xfffe2530, 0x00000000, 0, 0, 0, 0 },
220 { 0x38, 0x000a5969, 0x000b1c72, 0x00000000, 0x00000000, 0, 0, 0, 0 },
221 { 0x39, 0x000a5969, 0x000b1c72, 0x00000000, 0x00000000, 0, 0, 0, 0 },
222 { 0x3a, 0x000c5149, 0x0006e38e, 0x00000000, 0x00000000, 0, 0, 0, 0 },
223 { 0x3b, 0x00095d79, 0x000c0000, 0x0000e38e, 0x00000000, 0, 0, 0, 0 },
224 { 0x3c, 0x000d4d39, 0x000b1c72, 0x00000000, 0x00000000, 0, 0, 0, 0 },
225 { 0x3d, 0x000d4d39, 0x000b1c72, 0x00000000, 0x00000000, 0, 0, 0, 0 },
226 { 0x3e, 0x000e4929, 0x000b1c72, 0x00000000, 0x00000000, 0, 0, 0, 0 },
227 { 0x3f, 0x000e4929, 0x000b1c72, 0x00000000, 0x00000000, 0, 0, 0, 0 },
228 { 0x40, 0x000b5559, 0x000b1c72, 0x00000000, 0x00000000, 0, 0, 0, 0 },
229 { 0x41, 0x000eae80, 0x000aeef0, 0x00000000, 0x00000000, 1, C_41_Kerning, 0, 0 },
230 { 0x42, 0x000c0e15, 0x000aeef0, 0x00000000, 0x00006470, 1, C_42_Kerning, 0, 0 },
231 { 0x43, 0x0009ec47, 0x000aeef0, 0x00000000, 0x0000cc92, 1, C_43_Kerning, 0, 0 },
232 { 0x44, 0x000e3b30, 0x000aeef0, 0x00000000, 0x00007df9, 1, C_44_Kerning, 0, 0 },
233 { 0x45, 0x0009db75, 0x000aeef0, 0x00000000, 0x000159a0, 1, C_45_Kerning, 0, 0 },
234 { 0x46, 0x000d17fb, 0x000aeef0, 0x00000000, 0x00019cd9, 1, C_46_Kerning, 0, 0 },
235 { 0x47, 0x000b042b, 0x000aeef0, 0x00018e39, 0x0000e772, 1, C_47_Kerning, 0, 0 },
236 { 0x48, 0x000fa887, 0x000aeef0, 0x00000000, 0x00000000, 1, C_48_Kerning, 0, 0 },
237 { 0x49, 0x000a5812, 0x000aeef0, 0x00000000, 0x000109f7, 1, C_49_Kerning, 0, 0 },
238 { 0x4a, 0x000c83ae, 0x000aeef0, 0x00018e39, 0x0002fab7, 1, C_4a_Kerning, 0, 0 },
239 { 0x4b, 0x000df265, 0x000aeef0, 0x00000000, 0x00000589, 1, C_4b_Kerning, 0, 0 },
240 { 0x4c, 0x000caadb, 0x000aeef0, 0x00000000, 0x00000000, 1, C_4c_Kerning, 0, 0 },
241 { 0x4d, 0x00157ba7, 0x000aeef0, 0x00000000, 0x00000000, 1, C_4d_Kerning, 0, 0 },
242 { 0x4e, 0x000ef819, 0x000aeef0, 0x00000000, 0x000267c9, 1, C_4e_Kerning, 0, 0 },
243 { 0x4f, 0x000e7e50, 0x000aeef0, 0x00000000, 0x00007df9, 1, C_4f_Kerning, 0, 0 },
244 { 0x50, 0x000cf249, 0x000aeef0, 0x00000000, 0x000156e2, 1, C_50_Kerning, 0, 0 },
245 { 0x51, 0x000ef987, 0x000aeef0, 0x00018e39, 0x00000000, 1, C_51_Kerning, 0, 0 },
246 { 0x52, 0x000fb252, 0x000aeef0, 0x00000000, 0x00000000, 1, C_52_Kerning, 0, 0 },
247 { 0x53, 0x000b3c29, 0x000aeef0, 0x00000000, 0x00012720, 1, C_53_Kerning, 0, 0 },
248 { 0x54, 0x000a5d79, 0x000aeef0, 0x00000000, 0x00000000, 1, C_54_Kerning, 0, 0 },
249 { 0x55, 0x000b7c1b, 0x000aeef0, 0x00000000, 0x00019cd9, 1, C_55_Kerning, 0, 0 },
250 { 0x56, 0x000b84d2, 0x000aeef0, 0x00000000, 0x000156e2, 1, C_56_Kerning, 0, 0 },
251 { 0x57, 0x00122967, 0x000aeef0, 0x00000000, 0x000156e2, 1, C_57_Kerning, 0, 0 },
252 { 0x58, 0x000d1a09, 0x000aeef0, 0x00000000, 0x000257c5, 1, C_58_Kerning, 0, 0 },
253 { 0x59, 0x000c3ade, 0x000aeef0, 0x00018e39, 0x000156e2, 1, C_59_Kerning, 0, 0 },
254 { 0x5a, 0x000d2b97, 0x000aeef0, 0x00000000, 0x00014a47, 1, C_5a_Kerning, 0, 0 },
255 { 0x5b, 0x000c5149, 0x0008e390, 0x00000000, 0x00000000, 0, 0, 0, 0 },
256 { 0x5c, 0x000c5149, 0x0008e390, 0x00000000, 0x00000000, 0, 0, 0, 0 },
257 { 0x5d, 0x000c5149, 0x0008e390, 0x00000000, 0x00000000, 0, 0, 0, 0 },
258 { 0x5e, 0x000c5149, 0x0008e390, 0x00000000, 0x00000000, 0, 0, 0, 0 },
259 { 0x5f, 0x000c5149, 0x0008e390, 0x00000000, 0x00000000, 0, 0, 0, 0 },
260 { 0x60, 0x000b5559, 0x000b1c72, 0x00000000, 0x00000000, 0, 0, 0, 0 },
261 { 0x61, 0x000b5559, 0x000b1c72, 0x00000000, 0x00000000, 0, 0, 0, 0 },
262 { 0x62, 0x00086189, 0x000c0000, 0x00040000, 0x00000000, 0, 0, 0, 0 },
263 { 0x63, 0x00086189, 0x000c0000, 0x00040000, 0x00000000, 0, 0, 0, 0 },
264 { 0x64, 0x00086189, 0x000c0000, 0x00040000, 0x00000000, 0, 0, 0, 0 },
265 { 0x65, 0x00086189, 0x000c0000, 0x00040000, 0x00000000, 0, 0, 0, 0 },
266 { 0x66, 0x00095d79, 0x000c0000, 0x00040000, 0x00000000, 0, 0, 0, 0 },
267 { 0x67, 0x00095d79, 0x000c0000, 0x00040000, 0x00000000, 0, 0, 0, 0 },
268 { 0x68, 0x00076599, 0x000c0000, 0x00040000, 0x00000000, 0, 0, 0, 0 },
269 { 0x69, 0x00076599, 0x000c0000, 0x00040000, 0x00000000, 0, 0, 0, 0 },
270 { 0x6a, 0x00056db9, 0x000c0000, 0x00040000, 0x00000000, 0, 0, 0, 0 },
271 { 0x6b, 0x00095d79, 0x000c0000, 0x00040000, 0x00000000, 0, 0, 0, 0 },
272 { 0x6c, 0x00095d79, 0x000c0000, 0x00040000, 0x00000000, 0, 0, 0, 0 },
273 { 0x6d, 0x000b5559, 0x000c0000, 0x00040000, 0x00000000, 0, 0, 0, 0 },
274 { 0x6e, 0x00095d79, 0x000c0000, 0x00040000, 0x00000000, 0, 0, 0, 0 },
275 { 0x6f, 0x00056db9, 0x000b1c72, 0x00031c72, 0x00000000, 0, 0, 0, 0 },
276 { 0x70, 0x000f0415, 0x0000c6f2, 0x000f390e, 0x00000000, 0, 0, 0, 0 },
277 { 0x71, 0x000dbf02, 0x000aeef0, 0x00000000, 0x00000000, 0, 0, 0, 0 },
278 { 0x72, 0x000f4519, 0x000aeef0, 0x00000000, 0x00000000, 0, 0, 0, 0 },
279 { 0x73, 0x0007e59b, 0x000b1c72, 0x00031c72, 0x0001f7e0, 0, 0, 0, 0 },
280 { 0x74, 0x000c5149, 0x0008e390, 0x00000000, 0x00000000, 0, 0, 0, 0 },
281 { 0x75, 0x000c5149, 0x0008e390, 0x00000000, 0x00000000, 0, 0, 0, 0 },
282 { 0x76, 0x000e4929, 0x000af7ae, 0x0002f7ae, 0x00000000, 0, 0, 0, 0 },
283 { 0x77, 0x000e4929, 0x000af7ae, 0x0002f7ae, 0x00000000, 0, 0, 0, 0 },
284 { 0x78, 0x0008618b, 0x000b1c72, 0x00031c72, 0x00000000, 0, 0, 0, 0 },
285 { 0x79, 0x00086189, 0x000b1c72, 0x00031c72, 0x00000000, 0, 0, 0, 0 },
286 { 0x7a, 0x00086189, 0x000b1c72, 0x00031c72, 0x00000000, 0, 0, 0, 0 },
287 { 0x7b, 0x000b5559, 0x000b1c72, 0x00031c72, 0x00000000, 0, 0, 0, 0 },
288 { 0x7c, 0x000e4929, 0x000b1c72, 0x000212f7, 0x00000000, 0, 0, 0, 0 },
289 { 0x7d, 0x000e4929, 0x000b1c72, 0x000212f7, 0x00000000, 0, 0, 0, 0 },
290 { 0x7e, 0x000e4929, 0x000b1c72, 0x000212f7, 0x00000000, 0, 0, 0, 0 },
291 { 0x7f, 0x000e4929, 0x000b1c72, 0x000212f7, 0x00000000, 0, 0, 0, 0 }
292 };
293
294 void
cmsy7_tables(TFM::Font * & _font,TFM::Dimension * & _dimension,TFM::Character * & _character)295 cmsy7_tables(TFM::Font*& _font, TFM::Dimension*& _dimension, TFM::Character*& _character)
296 {
297 _font = &font;
298 _dimension = dimension;
299 _character = character;
300 }
301