]> git.saurik.com Git - apple/icu.git/blame - icuSources/test/perf/leperf/sfnt.h
ICU-66108.tar.gz
[apple/icu.git] / icuSources / test / perf / leperf / sfnt.h
CommitLineData
57a6839d
A
1/***************************************************************************
2*
f3c0d7a5
A
3* © 2016 and later: Unicode, Inc. and others.
4* License & terms of use: http://www.unicode.org/copyright.html#License
5*
6****************************************************************************/
7/***************************************************************************
8*
57a6839d
A
9* Copyright (C) 1998-2013, International Business Machines
10* Corporation and others. All Rights Reserved.
11*
12************************************************************************/
13
14#ifndef __SFNT_H
15#define __SFNT_H
16
17#include "layout/LETypes.h"
18
19U_NAMESPACE_USE
20
21#ifndef ANY_NUMBER
22#define ANY_NUMBER 1
23#endif
24
25struct DirectoryEntry
26{
27 le_uint32 tag;
28 le_uint32 checksum;
29 le_uint32 offset;
30 le_uint32 length;
31};
32
33#ifndef __cplusplus
34typedef struct DirectoryEntry DirectoryEntry;
35#endif
36
37struct SFNTDirectory
38{
39 le_uint32 scalerType;
40 le_uint16 numTables;
41 le_uint16 searchRange;
42 le_uint16 entrySelector;
43 le_uint16 rangeShift;
44 DirectoryEntry tableDirectory[ANY_NUMBER];
45};
46
47#ifndef __cplusplus
48typedef struct SFNTDirectory SFNTDirectory;
49#endif
50
51
52struct CMAPEncodingSubtableHeader
53{
54 le_uint16 platformID;
55 le_uint16 platformSpecificID;
56 le_uint32 encodingOffset;
57};
58
59#ifndef __cplusplus
60typedef struct CMAPEncodingSubtableHeader CMAPEncodingSubtableHeader;
61#endif
62
63struct CMAPTable
64{
65 le_uint16 version;
66 le_uint16 numberSubtables;
67 CMAPEncodingSubtableHeader encodingSubtableHeaders[ANY_NUMBER];
68};
69
70#ifndef __cplusplus
71typedef struct CMAPTable CMAPTable;
72#endif
73
74struct CMAPEncodingSubtable
75{
76 le_uint16 format;
77 le_uint16 length;
78 le_uint16 language;
79};
80
81#ifndef __cplusplus
82typedef struct CMAPEncodingSubtable CMAPEncodingSubtable;
83#endif
84
85#ifdef __cplusplus
86struct CMAPFormat0Encoding : CMAPEncodingSubtable
87{
88 le_uint8 glyphIndexArray[256];
89};
90#else
91struct CMAPFormat0Encoding
92{
93 CMAPEncodingSubtable base;
94
95 le_uint8 glyphIndexArray[256];
96};
97
98typedef struct CMAPFormat0Encoding CMAPFormat0Encoding;
99#endif
100
101struct CMAPFormat2Subheader
102{
103 le_uint16 firstCode;
104 le_uint16 entryCount;
105 le_int16 idDelta;
106 le_uint16 idRangeOffset;
107};
108
109#ifndef __cplusplus
110typedef struct CMAPFormat2Subheader CMAPFormat2Subheader;
111#endif
112
113#ifdef __cplusplus
114struct CMAPFormat2Encoding : CMAPEncodingSubtable
115{
116 le_uint16 subHeadKeys[256];
117 CMAPFormat2Subheader subheaders[ANY_NUMBER];
118};
119#else
120struct CMAPFormat2Encoding
121{
122 CMAPEncodingSubtable base;
123
124 le_uint16 subHeadKeys[256];
125 CMAPFormat2Subheader subheaders[ANY_NUMBER];
126};
127
128typedef struct CMAPFormat2Encoding CMAPFormat2Encoding;
129#endif
130
131#ifdef __cplusplus
132struct CMAPFormat4Encoding : CMAPEncodingSubtable
133{
134 le_uint16 segCountX2;
135 le_uint16 searchRange;
136 le_uint16 entrySelector;
137 le_uint16 rangeShift;
138 le_uint16 endCodes[ANY_NUMBER];
139/*
140 le_uint16 reservedPad;
141 le_uint16 startCodes[ANY_NUMBER];
142 le_uint16 idDelta[ANY_NUMBER];
143 le_uint16 idRangeOffset[ANY_NUMBER];
144 le_uint16 glyphIndexArray[ANY_NUMBER];
145*/
146};
147#else
148struct CMAPFormat4Encoding
149{
150 CMAPEncodingSubtable base;
151
152 le_uint16 segCountX2;
153 le_uint16 searchRange;
154 le_uint16 entrySelector;
155 le_uint16 rangeShift;
156 le_uint16 endCodes[ANY_NUMBER];
157/*
158// le_uint16 reservedPad;
159// le_uint16 startCodes[ANY_NUMBER];
160// le_uint16 idDelta[ANY_NUMBER];
161// le_uint16 idRangeOffset[ANY_NUMBER];
162// le_uint16 glyphIndexArray[ANY_NUMBER];
163*/
164};
165
166typedef struct CMAPFormat4Encoding CMAPFormat4Encoding;
167#endif
168
169#ifdef __cplusplus
170struct CMAPFormat6Encoding : CMAPEncodingSubtable
171{
172 le_uint16 firstCode;
173 le_uint16 entryCount;
174 le_uint16 glyphIndexArray[ANY_NUMBER];
175};
176#else
177struct CMAPFormat6Encoding
178{
179 CMAPEncodingSubtable base;
180
181 le_uint16 firstCode;
182 le_uint16 entryCount;
183 le_uint16 glyphIndexArray[ANY_NUMBER];
184};
185
186typedef struct CMAPFormat6Encoding CMAPFormat6Encoding;
187#endif
188
189struct CMAPEncodingSubtable32
190{
191 le_uint32 format;
192 le_uint32 length;
193 le_uint32 language;
194};
195
196#ifndef __cplusplus
197typedef struct CMAPEncodingSubtable32 CMAPEncodingSubtable32;
198#endif
199
200struct CMAPGroup
201{
202 le_uint32 startCharCode;
203 le_uint32 endCharCode;
204 le_uint32 startGlyphCode;
205};
206
207#ifndef __cplusplus
208typedef struct CMAPGroup CMAPGroup;
209#endif
210
211#ifdef __cplusplus
212struct CMAPFormat8Encoding : CMAPEncodingSubtable32
213{
214 le_uint32 is32[65536/32];
215 le_uint32 nGroups;
216 CMAPGroup groups[ANY_NUMBER];
217};
218#else
219struct CMAPFormat8Encoding
220{
221 CMAPEncodingSubtable32 base;
222
223 le_uint32 is32[65536/32];
224 le_uint32 nGroups;
225 CMAPGroup groups[ANY_NUMBER];
226};
227
228typedef struct CMAPFormat8Encoding CMAPFormat8Encoding;
229#endif
230
231#ifdef __cplusplus
232struct CMAPFormat10Encoding : CMAPEncodingSubtable32
233{
234 le_uint32 startCharCode;
235 le_uint32 numCharCodes;
236 le_uint16 glyphs[ANY_NUMBER];
237};
238#else
239struct CMAPFormat10Encoding
240{
241 CMAPEncodingSubtable32 base;
242
243 le_uint32 startCharCode;
244 le_uint32 numCharCodes;
245 le_uint16 glyphs[ANY_NUMBER];
246};
247
248typedef struct CMAPFormat10Encoding CMAPFormat10Encoding;
249#endif
250
251#ifdef __cplusplus
252struct CMAPFormat12Encoding : CMAPEncodingSubtable32
253{
254 le_uint32 nGroups;
255 CMAPGroup groups[ANY_NUMBER];
256};
257#else
258struct CMAPFormat12Encoding
259{
260 CMAPEncodingSubtable32 base;
261
262 le_uint32 nGroups;
263 CMAPGroup groups[ANY_NUMBER];
264};
265
266typedef struct CMAPFormat12Encoding CMAPFormat12Encoding;
267#endif
268
269typedef le_int32 fixed;
270
271struct BigDate
272{
273 le_uint32 bc;
274 le_uint32 ad;
275};
276
277#ifndef __cplusplus
278typedef struct BigDate BigDate;
279#endif
280
281struct HEADTable
282{
283 fixed version;
284 fixed fontRevision;
285 le_uint32 checksumAdjustment;
286 le_uint32 magicNumber;
287 le_uint16 flags;
288 le_uint16 unitsPerEm;
289 BigDate created;
290 BigDate modified;
291 le_int16 xMin;
292 le_int16 yMin;
293 le_int16 xMax;
294 le_int16 yMax;
295 le_int16 lowestRecPPEM;
296 le_int16 fontDirectionHint;
297 le_int16 indexToLocFormat;
298 le_int16 glyphDataFormat;
299};
300
301#ifndef __cplusplus
302typedef struct HEADTable HEADTable;
303#endif
304
305struct MAXPTable
306{
307 fixed version;
308 le_uint16 numGlyphs;
309 le_uint16 maxPoints;
310 le_uint16 maxContours;
311 le_uint16 maxComponentPoints;
312 le_uint16 maxComponentContours;
313 le_uint16 maxZones;
314 le_uint16 maxTwilightPoints;
315 le_uint16 maxStorage;
316 le_uint16 maxFunctionDefs;
317 le_uint16 maxInstructionDefs;
318 le_uint16 maxStackElements;
319 le_uint16 maxSizeOfInstructions;
320 le_uint16 maxComponentElements;
321 le_uint16 maxComponentDepth;
322};
323
324#ifndef __cplusplus
325typedef struct MAXPTable MAXPTable;
326#endif
327
328struct HHEATable
329{
330 fixed version;
331 le_int16 ascent;
332 le_int16 descent;
333 le_int16 lineGap;
334 le_uint16 advanceWidthMax;
335 le_int16 minLeftSideBearing;
336 le_int16 minRightSideBearing;
337 le_int16 xMaxExtent;
338 le_int16 caretSlopeRise;
339 le_int16 caretSlopeRun;
340 le_int16 caretOffset;
341 le_int16 reserved1;
342 le_int16 reserved2;
343 le_int16 reserved3;
344 le_int16 reserved4;
345 le_int16 metricDataFormat;
346 le_uint16 numOfLongHorMetrics;
347};
348
349#ifndef __cplusplus
350typedef struct HHEATable HHEATable;
351#endif
352
353struct LongHorMetric
354{
355 le_uint16 advanceWidth;
356 le_int16 leftSideBearing;
357};
358
359#ifndef __cplusplus
360typedef struct LongHorMetric LongHorMetric;
361#endif
362
363struct HMTXTable
364{
365 LongHorMetric hMetrics[ANY_NUMBER]; /* ANY_NUMBER = numOfLongHorMetrics from hhea table */
366/* le_int16 leftSideBearing[ANY_NUMBER]; ANY_NUMBER = numGlyphs - numOfLongHorMetrics */
367};
368
369#ifndef __cplusplus
370typedef struct HMTXTable HMTXTable;
371#endif
372
373enum PlatformID
374{
375 PLATFORM_UNICODE = 0,
376 PLATFORM_MACINTOSH = 1,
377 PLATFORM_ISO = 2,
378 PLATFORM_MICROSOFT = 3,
379 PLATFORM_CUSTOM = 4
380};
381
382enum MacintoshEncodingID
383{
384 MACINTOSH_ROMAN = 0
385};
386
387enum MacintoshLanguageID
388{
389 MACINTOSH_ENGLISH = 0
390};
391
392enum MicrosoftEncodingID
393{
394 MICROSOFT_UNICODE_BMP = 1,
395 MICROSOFT_UNICODE_FULL = 10
396};
397
398enum MicrosoftLanguageID
399{
400 MICROSOFT_ENGLISH = 0x409
401};
402
403enum NameID
404{
405 NAME_COPYRIGHT_NOTICE = 0,
406 NAME_FONT_FAMILY = 1,
407 NAME_FONT_SUB_FAMILY = 2,
408 NAME_UNIQUE_FONT_ID = 3,
409 NAME_FULL_FONT_NAME = 4,
410 NAME_VERSION_STRING = 5,
411 NAME_POSTSCRIPT_NAME = 6,
412 NAME_TRADEMARK = 7,
413 NAME_MANUFACTURER = 8,
414 NAME_DESIGNER = 9,
415 NAME_DESCRIPTION = 10,
416 NAME_VENDOR_URL = 11,
417 NAME_DESIGNER_URL = 12,
418 NAME_LICENSE_DESCRIPTION = 13,
419 NAME_LICENSE_URL = 14,
420 NAME_RESERVED = 15,
421 NAME_PREFERRED_FAMILY = 16,
422 NAME_PREFERRED_SUB_FAMILY = 17,
423 NAME_COMPATIBLE_FULL = 18,
424 NAME_SAMPLE_TEXT = 19,
425 NAME_POSTSCRIPT_CID = 20
426};
427
428struct NameRecord
429{
430 le_uint16 platformID;
431 le_uint16 encodingID;
432 le_uint16 languageID;
433 le_uint16 nameID;
434 le_uint16 length;
435 le_uint16 offset;
436};
437
438#ifndef __cplusplus
439typedef struct NameRecord NameRecord;
440#endif
441
442struct NAMETable
443{
444 le_uint16 version;
445 le_uint16 count;
446 le_uint16 stringOffset;
447 NameRecord nameRecords[ANY_NUMBER];
448};
449
450#ifndef __cplusplus
451typedef struct NAMETable NAMETable;
452#endif
453
454#endif
455