1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
|
/****************************************************************************\
Part of the XeTeX typesetting system
copyright (c) 1994-2006 by SIL International
written by Jonathan Kew
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL SIL INTERNATIONAL BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of SIL International
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in this Software without prior written
authorization from SIL International.
\****************************************************************************/
#ifndef __MATHTABLE_H__
#define __MATHTABLE_H__
#include "OpenTypeTables.h"
typedef struct {
le_int16 value;
le_uint16 deviceTable;
} MathValueRecord;
typedef struct {
le_uint32 version;
le_uint16 mathConstants;
le_uint16 mathGlyphInfo;
le_uint16 mathVariants;
} MathTableHeader;
typedef struct {
le_uint16 scriptPercentScaleDown;
le_uint16 scriptScriptPercentScaleDown;
le_uint16 delimitedSubFormulaMinHeight;
le_uint16 displayOperatorMinHeight;
MathValueRecord mathLeading;
MathValueRecord axisHeight;
MathValueRecord accentBaseHeight;
MathValueRecord flattenedAccentBaseHeight;
MathValueRecord subscriptShiftDown;
MathValueRecord subscriptTopMax;
MathValueRecord subscriptBaselineDropMin;
MathValueRecord superscriptShiftUp;
MathValueRecord superscriptShiftUpCramped;
MathValueRecord superscriptBottomMin;
MathValueRecord superscriptBaselineDropMax;
MathValueRecord subSuperscriptGapMin;
MathValueRecord superscriptBottomMaxWithSubscript;
MathValueRecord spaceAfterScript;
MathValueRecord upperLimitGapMin;
MathValueRecord upperLimitBaselineRiseMin;
MathValueRecord lowerLimitGapMin;
MathValueRecord lowerLimitBaselineDropMin;
MathValueRecord stackTopShiftUp;
MathValueRecord stackTopDisplayStyleShiftUp;
MathValueRecord stackBottomShiftDown;
MathValueRecord stackBottomDisplayStyleShiftDown;
MathValueRecord stackGapMin;
MathValueRecord stackDisplayStyleGapMin;
MathValueRecord stretchStackTopShiftUp;
MathValueRecord stretchStackBottomShiftDown;
MathValueRecord stretchStackGapAboveMin;
MathValueRecord stretchStackGapBelowMin;
MathValueRecord fractionNumeratorShiftUp;
MathValueRecord fractionNumeratorDisplayStyleShiftUp;
MathValueRecord fractionDenominatorShiftDown;
MathValueRecord fractionDenominatorDisplayStyleShiftDown;
MathValueRecord fractionNumeratorGapMin;
MathValueRecord fractionNumDiisplayStyleGapMin;
MathValueRecord fractionRuleThickness;
MathValueRecord fractionDenominatorGapMin;
MathValueRecord fractionDenomDisplayStyleGapMin;
MathValueRecord skewedFractionHorizontalGap;
MathValueRecord skewedFractionVerticalGap;
MathValueRecord overbarVerticalGap;
MathValueRecord overbarRuleThickness;
MathValueRecord overbarExtraAscender;
MathValueRecord underbarVerticalGap;
MathValueRecord underbarRuleThickness;
MathValueRecord underbarExtraDescender;
MathValueRecord radicalVerticalGap;
MathValueRecord radicalDisplayStyleVerticalGap;
MathValueRecord radicalRuleThickness;
MathValueRecord radicalExtraAscender;
MathValueRecord radicalKernBeforeDegree;
MathValueRecord radicalKernAfterDegree;
le_uint16 radicalDegreeBottomRaisePercent;
} MathConstants;
typedef enum {
unknown = -1,
scriptPercentScaleDown = 0,
scriptScriptPercentScaleDown,
delimitedSubFormulaMinHeight,
displayOperatorMinHeight,
mathLeading,
firstMathValueRecord = mathLeading,
axisHeight,
accentBaseHeight,
flattenedAccentBaseHeight,
subscriptShiftDown,
subscriptTopMax,
subscriptBaselineDropMin,
superscriptShiftUp,
superscriptShiftUpCramped,
superscriptBottomMin,
superscriptBaselineDropMax,
subSuperscriptGapMin,
superscriptBottomMaxWithSubscript,
spaceAfterScript,
upperLimitGapMin,
upperLimitBaselineRiseMin,
lowerLimitGapMin,
lowerLimitBaselineDropMin,
stackTopShiftUp,
stackTopDisplayStyleShiftUp,
stackBottomShiftDown,
stackBottomDisplayStyleShiftDown,
stackGapMin,
stackDisplayStyleGapMin,
stretchStackTopShiftUp,
stretchStackBottomShiftDown,
stretchStackGapAboveMin,
stretchStackGapBelowMin,
fractionNumeratorShiftUp,
fractionNumeratorDisplayStyleShiftUp,
fractionDenominatorShiftDown,
fractionDenominatorDisplayStyleShiftDown,
fractionNumeratorGapMin,
fractionNumDisplayStyleGapMin,
fractionRuleThickness,
fractionDenominatorGapMin,
fractionDenomDisplayStyleGapMin,
skewedFractionHorizontalGap,
skewedFractionVerticalGap,
overbarVerticalGap,
overbarRuleThickness,
overbarExtraAscender,
underbarVerticalGap,
underbarRuleThickness,
underbarExtraDescender,
radicalVerticalGap,
radicalDisplayStyleVerticalGap,
radicalRuleThickness,
radicalExtraAscender,
radicalKernBeforeDegree,
radicalKernAfterDegree,
lastMathValueRecord = radicalKernAfterDegree,
radicalDegreeBottomRaisePercent,
lastMathConstant = radicalDegreeBottomRaisePercent
} mathConstantIndex;
typedef struct {
le_uint16 minConnectorOverlap;
Offset vertGlyphCoverage;
Offset horizGlyphCoverage;
le_uint16 vertGlyphCount;
le_uint16 horizGlyphCount;
Offset vertGlyphConstruction[ANY_NUMBER];
Offset horizGlyphConstruction[ANY_NUMBER];
} MathVariants;
typedef struct {
TTGlyphID variantGlyph;
le_uint16 advanceMeasurement;
} MathGlyphVariantRecord;
typedef struct {
Offset glyphAssembly;
le_uint16 variantCount;
MathGlyphVariantRecord mathGlyphVariantRecord[ANY_NUMBER];
} MathGlyphConstruction;
typedef struct {
TTGlyphID glyph;
le_uint16 startConnectorLength;
le_uint16 endConnectorLength;
le_uint16 fullAdvance;
le_uint16 partFlags;
} GlyphPartRecord;
#define fExtender 0x0001
typedef struct {
MathValueRecord italicsCorrection;
le_uint16 partCount;
GlyphPartRecord partRecords[ANY_NUMBER];
} GlyphAssembly;
typedef struct {
le_uint16 mathItalicsCorrectionInfo;
le_uint16 mathTopAccentAttachment;
le_uint16 extendedShapeCoverage;
le_uint16 mathKernInfo;
} MathGlyphInfo;
typedef struct {
le_uint16 coverage;
le_uint16 italicsCorrectionCount;
MathValueRecord italicsCorrection[ANY_NUMBER];
} MathItalicsCorrectionInfo;
#endif
|