OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1998-2004 David Turner and Werner Lemberg | 2 * Copyright (C) 1998-2004 David Turner and Werner Lemberg |
3 * Copyright (C) 2006 Behdad Esfahbod | 3 * Copyright (C) 2006 Behdad Esfahbod |
4 * | 4 * |
5 * This is part of HarfBuzz, an OpenType Layout engine library. | 5 * This is part of HarfBuzz, an OpenType Layout engine library. |
6 * | 6 * |
7 * Permission is hereby granted, without written agreement and without | 7 * Permission is hereby granted, without written agreement and without |
8 * license or royalty fees, to use, copy, modify, and distribute this | 8 * license or royalty fees, to use, copy, modify, and distribute this |
9 * software and its documentation for any purpose, provided that the | 9 * software and its documentation for any purpose, provided that the |
10 * above copyright notice and the following two paragraphs appear in | 10 * above copyright notice and the following two paragraphs appear in |
(...skipping 12 matching lines...) Expand all Loading... |
23 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 23 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef HARFBUZZ_OPEN_H | 26 #ifndef HARFBUZZ_OPEN_H |
27 #define HARFBUZZ_OPEN_H | 27 #define HARFBUZZ_OPEN_H |
28 | 28 |
29 #include "harfbuzz-global.h" | 29 #include "harfbuzz-global.h" |
30 | 30 |
31 HB_BEGIN_HEADER | 31 HB_BEGIN_HEADER |
32 | 32 |
| 33 #ifdef HB_USE_PACKED_STRUCTS |
| 34 #pragma pack(push, 1) |
| 35 #endif |
| 36 |
33 /* Use this if a feature applies to all glyphs */ | 37 /* Use this if a feature applies to all glyphs */ |
34 #define HB_ALL_GLYPHS 0xFFFF | 38 #define HB_ALL_GLYPHS 0xFFFF |
35 | 39 |
36 #define HB_DEFAULT_LANGUAGE 0xFFFF | 40 #define HB_DEFAULT_LANGUAGE 0xFFFF |
37 | 41 |
38 #define HB_MAX_NESTING_LEVEL 100 | 42 #define HB_MAX_NESTING_LEVEL 100 |
39 | 43 |
40 | 44 |
41 /* Script list related structures */ | 45 /* Script list related structures */ |
42 | 46 |
43 struct HB_LangSys_ | 47 struct HB_LangSys_ |
44 { | 48 { |
| 49 HB_UShort* FeatureIndex; /* array of Feature indices */ |
45 HB_UShort LookupOrderOffset; /* always 0 for TT Open 1.0 */ | 50 HB_UShort LookupOrderOffset; /* always 0 for TT Open 1.0 */ |
46 HB_UShort ReqFeatureIndex; /* required FeatureIndex */ | 51 HB_UShort ReqFeatureIndex; /* required FeatureIndex */ |
47 HB_UShort FeatureCount; /* number of Feature indices */ | 52 HB_UShort FeatureCount; /* number of Feature indices */ |
48 HB_UShort* FeatureIndex; /* array of Feature indices */ | |
49 }; | 53 }; |
50 | 54 |
51 typedef struct HB_LangSys_ HB_LangSys; | 55 typedef struct HB_LangSys_ HB_LangSys; |
52 | 56 |
53 | 57 |
54 struct HB_LangSysRecord_ | 58 struct HB_LangSysRecord_ |
55 { | 59 { |
| 60 HB_LangSys LangSys; /* LangSys table */ |
56 HB_UInt LangSysTag; /* LangSysTag identifier */ | 61 HB_UInt LangSysTag; /* LangSysTag identifier */ |
57 HB_LangSys LangSys; /* LangSys table */ | |
58 }; | 62 }; |
59 | 63 |
60 typedef struct HB_LangSysRecord_ HB_LangSysRecord; | 64 typedef struct HB_LangSysRecord_ HB_LangSysRecord; |
61 | 65 |
62 | 66 |
63 struct HB_ScriptTable_ | 67 struct HB_ScriptTable_ |
64 { | 68 { |
| 69 HB_LangSysRecord* LangSysRecord; /* array of LangSysRecords */ |
65 HB_LangSys DefaultLangSys; /* DefaultLangSys table */ | 70 HB_LangSys DefaultLangSys; /* DefaultLangSys table */ |
66 HB_UShort LangSysCount; /* number of LangSysRecords */ | 71 HB_UShort LangSysCount; /* number of LangSysRecords */ |
67 HB_LangSysRecord* LangSysRecord; /* array of LangSysRecords */ | |
68 }; | 72 }; |
69 | 73 |
70 typedef struct HB_ScriptTable_ HB_ScriptTable; | 74 typedef struct HB_ScriptTable_ HB_ScriptTable; |
71 | 75 |
72 | 76 |
73 struct HB_ScriptRecord_ | 77 struct HB_ScriptRecord_ |
74 { | 78 { |
75 HB_UInt ScriptTag; /* ScriptTag identifier */ | 79 HB_UInt ScriptTag; /* ScriptTag identifier */ |
76 HB_ScriptTable Script; /* Script table */ | 80 HB_ScriptTable Script; /* Script table */ |
77 }; | 81 }; |
78 | 82 |
79 typedef struct HB_ScriptRecord_ HB_ScriptRecord; | 83 typedef struct HB_ScriptRecord_ HB_ScriptRecord; |
80 | 84 |
81 | 85 |
82 struct HB_ScriptList_ | 86 struct HB_ScriptList_ |
83 { | 87 { |
| 88 HB_ScriptRecord* ScriptRecord; /* array of ScriptRecords */ |
84 HB_UShort ScriptCount; /* number of ScriptRecords */ | 89 HB_UShort ScriptCount; /* number of ScriptRecords */ |
85 HB_ScriptRecord* ScriptRecord; /* array of ScriptRecords */ | |
86 }; | 90 }; |
87 | 91 |
88 typedef struct HB_ScriptList_ HB_ScriptList; | 92 typedef struct HB_ScriptList_ HB_ScriptList; |
89 | 93 |
90 | 94 |
91 /* Feature list related structures */ | 95 /* Feature list related structures */ |
92 | 96 |
93 struct HB_Feature_ | 97 struct HB_Feature_ |
94 { | 98 { |
| 99 HB_UShort* LookupListIndex; /* array of LookupList indices */ |
95 HB_UShort FeatureParams; /* always 0 for TT Open 1.0 */ | 100 HB_UShort FeatureParams; /* always 0 for TT Open 1.0 */ |
96 HB_UShort LookupListCount; /* number of LookupList indices */ | 101 HB_UShort LookupListCount; /* number of LookupList indices */ |
97 HB_UShort* LookupListIndex; /* array of LookupList indices */ | |
98 }; | 102 }; |
99 | 103 |
100 typedef struct HB_Feature_ HB_Feature; | 104 typedef struct HB_Feature_ HB_Feature; |
101 | 105 |
102 | 106 |
103 struct HB_FeatureRecord_ | 107 struct HB_FeatureRecord_ |
104 { | 108 { |
105 HB_UInt FeatureTag; /* FeatureTag identifier */ | 109 HB_UInt FeatureTag; /* FeatureTag identifier */ |
106 HB_Feature Feature; /* Feature table */ | 110 HB_Feature Feature; /* Feature table */ |
107 }; | 111 }; |
108 | 112 |
109 typedef struct HB_FeatureRecord_ HB_FeatureRecord; | 113 typedef struct HB_FeatureRecord_ HB_FeatureRecord; |
110 | 114 |
111 | 115 |
112 struct HB_FeatureList_ | 116 struct HB_FeatureList_ |
113 { | 117 { |
| 118 HB_UShort* ApplyOrder; /* order to apply features */ |
| 119 HB_FeatureRecord* FeatureRecord; /* array of FeatureRecords */ |
114 HB_UShort FeatureCount; /* number of FeatureRecords */ | 120 HB_UShort FeatureCount; /* number of FeatureRecords */ |
115 HB_FeatureRecord* FeatureRecord; /* array of FeatureRecords */ | |
116 HB_UShort* ApplyOrder; /* order to apply features */ | |
117 HB_UShort ApplyCount; /* number of elements in ApplyOrder */ | 121 HB_UShort ApplyCount; /* number of elements in ApplyOrder */ |
118 }; | 122 }; |
119 | 123 |
120 typedef struct HB_FeatureList_ HB_FeatureList; | 124 typedef struct HB_FeatureList_ HB_FeatureList; |
121 | 125 |
122 | 126 |
123 /* Lookup list related structures */ | 127 /* Lookup list related structures */ |
124 | 128 |
125 typedef struct HB_SubTable_ HB_SubTable; | 129 typedef struct HB_SubTable_ HB_SubTable; |
126 | 130 |
127 | 131 |
128 struct HB_Lookup_ | 132 struct HB_Lookup_ |
129 { | 133 { |
| 134 HB_SubTable* SubTable; /* array of SubTables */ |
130 HB_UShort LookupType; /* Lookup type */ | 135 HB_UShort LookupType; /* Lookup type */ |
131 HB_UShort LookupFlag; /* Lookup qualifiers */ | 136 HB_UShort LookupFlag; /* Lookup qualifiers */ |
132 HB_UShort SubTableCount; /* number of SubTables */ | 137 HB_UShort SubTableCount; /* number of SubTables */ |
133 HB_SubTable* SubTable; /* array of SubTables */ | |
134 }; | 138 }; |
135 | 139 |
136 typedef struct HB_Lookup_ HB_Lookup; | 140 typedef struct HB_Lookup_ HB_Lookup; |
137 | 141 |
138 | 142 |
139 /* The `Properties' field is not defined in the OpenType specification but | 143 /* The `Properties' field is not defined in the OpenType specification but |
140 is needed for processing lookups. If properties[n] is > 0, the | 144 is needed for processing lookups. If properties[n] is > 0, the |
141 functions HB_GSUB_Apply_String() resp. HB_GPOS_Apply_String() will | 145 functions HB_GSUB_Apply_String() resp. HB_GPOS_Apply_String() will |
142 process Lookup[n] for glyphs which have the specific bit not set in | 146 process Lookup[n] for glyphs which have the specific bit not set in |
143 the `properties' field of the input string object. */ | 147 the `properties' field of the input string object. */ |
144 | 148 |
145 struct HB_LookupList_ | 149 struct HB_LookupList_ |
146 { | 150 { |
147 HB_UShort LookupCount; /* number of Lookups */ | |
148 HB_Lookup* Lookup; /* array of Lookup records */ | 151 HB_Lookup* Lookup; /* array of Lookup records */ |
149 HB_UInt* Properties; /* array of flags */ | 152 HB_UInt* Properties; /* array of flags */ |
| 153 HB_UShort LookupCount; /* number of Lookups */ |
150 }; | 154 }; |
151 | 155 |
152 typedef struct HB_LookupList_ HB_LookupList; | 156 typedef struct HB_LookupList_ HB_LookupList; |
153 | 157 |
154 | 158 |
155 /* Possible LookupFlag bit masks. `HB_LOOKUP_FLAG_IGNORE_SPECIAL_MARKS' comes f
rom the | 159 /* Possible LookupFlag bit masks. `HB_LOOKUP_FLAG_IGNORE_SPECIAL_MARKS' comes f
rom the |
156 OpenType 1.2 specification; HB_LOOKUP_FLAG_RIGHT_TO_LEFT has been (re)introdu
ced in | 160 OpenType 1.2 specification; HB_LOOKUP_FLAG_RIGHT_TO_LEFT has been (re)introdu
ced in |
157 OpenType 1.3 -- if set, the last glyph in a cursive attachment | 161 OpenType 1.3 -- if set, the last glyph in a cursive attachment |
158 sequence has to be positioned on the baseline -- regardless of the | 162 sequence has to be positioned on the baseline -- regardless of the |
159 writing direction. */ | 163 writing direction. */ |
160 | 164 |
161 #define HB_LOOKUP_FLAG_RIGHT_TO_LEFT 0x0001 | 165 #define HB_LOOKUP_FLAG_RIGHT_TO_LEFT 0x0001 |
162 #define HB_LOOKUP_FLAG_IGNORE_BASE_GLYPHS 0x0002 | 166 #define HB_LOOKUP_FLAG_IGNORE_BASE_GLYPHS 0x0002 |
163 #define HB_LOOKUP_FLAG_IGNORE_LIGATURES 0x0004 | 167 #define HB_LOOKUP_FLAG_IGNORE_LIGATURES 0x0004 |
164 #define HB_LOOKUP_FLAG_IGNORE_MARKS 0x0008 | 168 #define HB_LOOKUP_FLAG_IGNORE_MARKS 0x0008 |
165 #define HB_LOOKUP_FLAG_IGNORE_SPECIAL_MARKS 0xFF00 | 169 #define HB_LOOKUP_FLAG_IGNORE_SPECIAL_MARKS 0xFF00 |
166 | 170 |
167 | 171 |
168 struct HB_CoverageFormat1_ | 172 struct HB_CoverageFormat1_ |
169 { | 173 { |
| 174 HB_UShort* GlyphArray; /* array of glyph IDs */ |
170 HB_UShort GlyphCount; /* number of glyphs in GlyphArray */ | 175 HB_UShort GlyphCount; /* number of glyphs in GlyphArray */ |
171 HB_UShort* GlyphArray; /* array of glyph IDs */ | |
172 }; | 176 }; |
173 | 177 |
174 typedef struct HB_CoverageFormat1_ HB_CoverageFormat1; | 178 typedef struct HB_CoverageFormat1_ HB_CoverageFormat1; |
175 | 179 |
176 | 180 |
177 struct HB_RangeRecord_ | 181 struct HB_RangeRecord_ |
178 { | 182 { |
179 HB_UShort Start; /* first glyph ID in the range */ | 183 HB_UShort Start; /* first glyph ID in the range */ |
180 HB_UShort End; /* last glyph ID in the range */ | 184 HB_UShort End; /* last glyph ID in the range */ |
181 HB_UShort StartCoverageIndex; /* coverage index of first | 185 HB_UShort StartCoverageIndex; /* coverage index of first |
182 glyph ID in the range */ | 186 glyph ID in the range */ |
183 }; | 187 }; |
184 | 188 |
185 typedef struct HB_RangeRecord_ HB_RangeRecord; | 189 typedef struct HB_RangeRecord_ HB_RangeRecord; |
186 | 190 |
187 | 191 |
188 struct HB_CoverageFormat2_ | 192 struct HB_CoverageFormat2_ |
189 { | 193 { |
| 194 HB_RangeRecord* RangeRecord; /* array of RangeRecords */ |
190 HB_UShort RangeCount; /* number of RangeRecords */ | 195 HB_UShort RangeCount; /* number of RangeRecords */ |
191 HB_RangeRecord* RangeRecord; /* array of RangeRecords */ | |
192 }; | 196 }; |
193 | 197 |
194 typedef struct HB_CoverageFormat2_ HB_CoverageFormat2; | 198 typedef struct HB_CoverageFormat2_ HB_CoverageFormat2; |
195 | 199 |
196 | 200 |
197 struct HB_Coverage_ | 201 struct HB_Coverage_ |
198 { | 202 { |
199 HB_UShort CoverageFormat; /* 1 or 2 */ | 203 HB_Byte CoverageFormat; /* 1 or 2 */ |
200 | 204 |
201 union | 205 union |
202 { | 206 { |
203 HB_CoverageFormat1 cf1; | 207 HB_CoverageFormat1 cf1; |
204 HB_CoverageFormat2 cf2; | 208 HB_CoverageFormat2 cf2; |
205 } cf; | 209 } cf; |
206 }; | 210 }; |
207 | 211 |
208 typedef struct HB_Coverage_ HB_Coverage; | 212 typedef struct HB_Coverage_ HB_Coverage; |
209 | 213 |
210 | 214 |
211 struct HB_ClassDefFormat1_ | 215 struct HB_ClassDefFormat1_ |
212 { | 216 { |
| 217 HB_UShort* ClassValueArray; /* array of class values */ |
213 HB_UShort StartGlyph; /* first glyph ID of the | 218 HB_UShort StartGlyph; /* first glyph ID of the |
214 ClassValueArray */ | 219 ClassValueArray */ |
215 HB_UShort GlyphCount; /* size of the ClassValueArray */ | 220 HB_UShort GlyphCount; /* size of the ClassValueArray */ |
216 HB_UShort* ClassValueArray; /* array of class values */ | |
217 }; | 221 }; |
218 | 222 |
219 typedef struct HB_ClassDefFormat1_ HB_ClassDefFormat1; | 223 typedef struct HB_ClassDefFormat1_ HB_ClassDefFormat1; |
220 | 224 |
221 | 225 |
222 struct HB_ClassRangeRecord_ | 226 struct HB_ClassRangeRecord_ |
223 { | 227 { |
224 HB_UShort Start; /* first glyph ID in the range */ | 228 HB_UShort Start; /* first glyph ID in the range */ |
225 HB_UShort End; /* last glyph ID in the range */ | 229 HB_UShort End; /* last glyph ID in the range */ |
226 HB_UShort Class; /* applied to all glyphs in range */ | 230 HB_UShort Class; /* applied to all glyphs in range */ |
227 }; | 231 }; |
228 | 232 |
229 typedef struct HB_ClassRangeRecord_ HB_ClassRangeRecord; | 233 typedef struct HB_ClassRangeRecord_ HB_ClassRangeRecord; |
230 | 234 |
231 | 235 |
232 struct HB_ClassDefFormat2_ | 236 struct HB_ClassDefFormat2_ |
233 { | 237 { |
| 238 HB_ClassRangeRecord* ClassRangeRecord; |
| 239 /* array of ClassRangeRecords */ |
234 HB_UShort ClassRangeCount; | 240 HB_UShort ClassRangeCount; |
235 /* number of ClassRangeRecords */ | 241 /* number of ClassRangeRecords */ |
236 HB_ClassRangeRecord* ClassRangeRecord; | |
237 /* array of ClassRangeRecords */ | |
238 }; | 242 }; |
239 | 243 |
240 typedef struct HB_ClassDefFormat2_ HB_ClassDefFormat2; | 244 typedef struct HB_ClassDefFormat2_ HB_ClassDefFormat2; |
241 | 245 |
242 | 246 |
243 struct HB_ClassDefinition_ | 247 struct HB_ClassDefinition_ |
244 { | 248 { |
245 HB_Bool loaded; | |
246 | |
247 HB_UShort ClassFormat; /* 1 or 2 */ | |
248 | |
249 union | 249 union |
250 { | 250 { |
251 HB_ClassDefFormat1 cd1; | 251 HB_ClassDefFormat1 cd1; |
252 HB_ClassDefFormat2 cd2; | 252 HB_ClassDefFormat2 cd2; |
253 } cd; | 253 } cd; |
| 254 |
| 255 HB_Byte ClassFormat; /* 1 or 2 */ |
| 256 HB_Bool loaded; |
254 }; | 257 }; |
255 | 258 |
256 typedef struct HB_ClassDefinition_ HB_ClassDefinition; | 259 typedef struct HB_ClassDefinition_ HB_ClassDefinition; |
257 | 260 |
258 | 261 |
259 struct HB_Device_ | 262 struct HB_Device_ |
260 { | 263 { |
| 264 HB_UShort* DeltaValue; /* array of compressed data */ |
261 HB_UShort StartSize; /* smallest size to correct */ | 265 HB_UShort StartSize; /* smallest size to correct */ |
262 HB_UShort EndSize; /* largest size to correct */ | 266 HB_UShort EndSize; /* largest size to correct */ |
263 HB_UShort DeltaFormat; /* DeltaValue array data format: | 267 HB_Byte DeltaFormat; /* DeltaValue array data format: |
264 1, 2, or 3 */ | 268 1, 2, or 3 */ |
265 HB_UShort* DeltaValue; /* array of compressed data */ | |
266 }; | 269 }; |
267 | 270 |
268 typedef struct HB_Device_ HB_Device; | 271 typedef struct HB_Device_ HB_Device; |
269 | 272 |
270 | 273 |
271 enum HB_Type_ | 274 enum HB_Type_ |
272 { | 275 { |
273 HB_Type_GSUB, | 276 HB_Type_GSUB, |
274 HB_Type_GPOS | 277 HB_Type_GPOS |
275 }; | 278 }; |
276 | 279 |
277 typedef enum HB_Type_ HB_Type; | 280 typedef enum HB_Type_ HB_Type; |
278 | 281 |
| 282 #ifdef HB_USE_PACKED_STRUCTS |
| 283 #pragma pack(pop) |
| 284 #endif |
279 | 285 |
280 HB_END_HEADER | 286 HB_END_HEADER |
281 | 287 |
282 #endif /* HARFBUZZ_OPEN_H */ | 288 #endif /* HARFBUZZ_OPEN_H */ |
OLD | NEW |