1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /***************************************************************************
5 * Copyright (C) 1998-2013, International Business Machines
6 * Corporation and others. All Rights Reserved.
8 ************************************************************************/
13 #include "layout/LETypes.h"
30 typedef struct DirectoryEntry DirectoryEntry
;
37 le_uint16 searchRange
;
38 le_uint16 entrySelector
;
40 DirectoryEntry tableDirectory
[ANY_NUMBER
];
44 typedef struct SFNTDirectory SFNTDirectory
;
48 struct CMAPEncodingSubtableHeader
51 le_uint16 platformSpecificID
;
52 le_uint32 encodingOffset
;
56 typedef struct CMAPEncodingSubtableHeader CMAPEncodingSubtableHeader
;
62 le_uint16 numberSubtables
;
63 CMAPEncodingSubtableHeader encodingSubtableHeaders
[ANY_NUMBER
];
67 typedef struct CMAPTable CMAPTable
;
70 struct CMAPEncodingSubtable
78 typedef struct CMAPEncodingSubtable CMAPEncodingSubtable
;
82 struct CMAPFormat0Encoding
: CMAPEncodingSubtable
84 le_uint8 glyphIndexArray
[256];
87 struct CMAPFormat0Encoding
89 CMAPEncodingSubtable base
;
91 le_uint8 glyphIndexArray
[256];
94 typedef struct CMAPFormat0Encoding CMAPFormat0Encoding
;
97 struct CMAPFormat2Subheader
100 le_uint16 entryCount
;
102 le_uint16 idRangeOffset
;
106 typedef struct CMAPFormat2Subheader CMAPFormat2Subheader
;
110 struct CMAPFormat2Encoding
: CMAPEncodingSubtable
112 le_uint16 subHeadKeys
[256];
113 CMAPFormat2Subheader subheaders
[ANY_NUMBER
];
116 struct CMAPFormat2Encoding
118 CMAPEncodingSubtable base
;
120 le_uint16 subHeadKeys
[256];
121 CMAPFormat2Subheader subheaders
[ANY_NUMBER
];
124 typedef struct CMAPFormat2Encoding CMAPFormat2Encoding
;
128 struct CMAPFormat4Encoding
: CMAPEncodingSubtable
130 le_uint16 segCountX2
;
131 le_uint16 searchRange
;
132 le_uint16 entrySelector
;
133 le_uint16 rangeShift
;
134 le_uint16 endCodes
[ANY_NUMBER
];
136 le_uint16 reservedPad;
137 le_uint16 startCodes[ANY_NUMBER];
138 le_uint16 idDelta[ANY_NUMBER];
139 le_uint16 idRangeOffset[ANY_NUMBER];
140 le_uint16 glyphIndexArray[ANY_NUMBER];
144 struct CMAPFormat4Encoding
146 CMAPEncodingSubtable base
;
148 le_uint16 segCountX2
;
149 le_uint16 searchRange
;
150 le_uint16 entrySelector
;
151 le_uint16 rangeShift
;
152 le_uint16 endCodes
[ANY_NUMBER
];
154 // le_uint16 reservedPad;
155 // le_uint16 startCodes[ANY_NUMBER];
156 // le_uint16 idDelta[ANY_NUMBER];
157 // le_uint16 idRangeOffset[ANY_NUMBER];
158 // le_uint16 glyphIndexArray[ANY_NUMBER];
162 typedef struct CMAPFormat4Encoding CMAPFormat4Encoding
;
166 struct CMAPFormat6Encoding
: CMAPEncodingSubtable
169 le_uint16 entryCount
;
170 le_uint16 glyphIndexArray
[ANY_NUMBER
];
173 struct CMAPFormat6Encoding
175 CMAPEncodingSubtable base
;
178 le_uint16 entryCount
;
179 le_uint16 glyphIndexArray
[ANY_NUMBER
];
182 typedef struct CMAPFormat6Encoding CMAPFormat6Encoding
;
185 struct CMAPEncodingSubtable32
193 typedef struct CMAPEncodingSubtable32 CMAPEncodingSubtable32
;
198 le_uint32 startCharCode
;
199 le_uint32 endCharCode
;
200 le_uint32 startGlyphCode
;
204 typedef struct CMAPGroup CMAPGroup
;
208 struct CMAPFormat8Encoding
: CMAPEncodingSubtable32
210 le_uint32 is32
[65536/32];
212 CMAPGroup groups
[ANY_NUMBER
];
215 struct CMAPFormat8Encoding
217 CMAPEncodingSubtable32 base
;
219 le_uint32 is32
[65536/32];
221 CMAPGroup groups
[ANY_NUMBER
];
224 typedef struct CMAPFormat8Encoding CMAPFormat8Encoding
;
228 struct CMAPFormat10Encoding
: CMAPEncodingSubtable32
230 le_uint32 startCharCode
;
231 le_uint32 numCharCodes
;
232 le_uint16 glyphs
[ANY_NUMBER
];
235 struct CMAPFormat10Encoding
237 CMAPEncodingSubtable32 base
;
239 le_uint32 startCharCode
;
240 le_uint32 numCharCodes
;
241 le_uint16 glyphs
[ANY_NUMBER
];
244 typedef struct CMAPFormat10Encoding CMAPFormat10Encoding
;
248 struct CMAPFormat12Encoding
: CMAPEncodingSubtable32
251 CMAPGroup groups
[ANY_NUMBER
];
254 struct CMAPFormat12Encoding
256 CMAPEncodingSubtable32 base
;
259 CMAPGroup groups
[ANY_NUMBER
];
262 typedef struct CMAPFormat12Encoding CMAPFormat12Encoding
;
265 typedef le_int32 fixed
;
274 typedef struct BigDate BigDate
;
281 le_uint32 checksumAdjustment
;
282 le_uint32 magicNumber
;
284 le_uint16 unitsPerEm
;
291 le_int16 lowestRecPPEM
;
292 le_int16 fontDirectionHint
;
293 le_int16 indexToLocFormat
;
294 le_int16 glyphDataFormat
;
298 typedef struct HEADTable HEADTable
;
306 le_uint16 maxContours
;
307 le_uint16 maxComponentPoints
;
308 le_uint16 maxComponentContours
;
310 le_uint16 maxTwilightPoints
;
311 le_uint16 maxStorage
;
312 le_uint16 maxFunctionDefs
;
313 le_uint16 maxInstructionDefs
;
314 le_uint16 maxStackElements
;
315 le_uint16 maxSizeOfInstructions
;
316 le_uint16 maxComponentElements
;
317 le_uint16 maxComponentDepth
;
321 typedef struct MAXPTable MAXPTable
;
330 le_uint16 advanceWidthMax
;
331 le_int16 minLeftSideBearing
;
332 le_int16 minRightSideBearing
;
334 le_int16 caretSlopeRise
;
335 le_int16 caretSlopeRun
;
336 le_int16 caretOffset
;
341 le_int16 metricDataFormat
;
342 le_uint16 numOfLongHorMetrics
;
346 typedef struct HHEATable HHEATable
;
351 le_uint16 advanceWidth
;
352 le_int16 leftSideBearing
;
356 typedef struct LongHorMetric LongHorMetric
;
361 LongHorMetric hMetrics
[ANY_NUMBER
]; /* ANY_NUMBER = numOfLongHorMetrics from hhea table */
362 /* le_int16 leftSideBearing[ANY_NUMBER]; ANY_NUMBER = numGlyphs - numOfLongHorMetrics */
366 typedef struct HMTXTable HMTXTable
;
371 PLATFORM_UNICODE
= 0,
372 PLATFORM_MACINTOSH
= 1,
374 PLATFORM_MICROSOFT
= 3,
378 enum MacintoshEncodingID
383 enum MacintoshLanguageID
385 MACINTOSH_ENGLISH
= 0
388 enum MicrosoftEncodingID
390 MICROSOFT_UNICODE_BMP
= 1,
391 MICROSOFT_UNICODE_FULL
= 10
394 enum MicrosoftLanguageID
396 MICROSOFT_ENGLISH
= 0x409
401 NAME_COPYRIGHT_NOTICE
= 0,
402 NAME_FONT_FAMILY
= 1,
403 NAME_FONT_SUB_FAMILY
= 2,
404 NAME_UNIQUE_FONT_ID
= 3,
405 NAME_FULL_FONT_NAME
= 4,
406 NAME_VERSION_STRING
= 5,
407 NAME_POSTSCRIPT_NAME
= 6,
409 NAME_MANUFACTURER
= 8,
411 NAME_DESCRIPTION
= 10,
412 NAME_VENDOR_URL
= 11,
413 NAME_DESIGNER_URL
= 12,
414 NAME_LICENSE_DESCRIPTION
= 13,
415 NAME_LICENSE_URL
= 14,
417 NAME_PREFERRED_FAMILY
= 16,
418 NAME_PREFERRED_SUB_FAMILY
= 17,
419 NAME_COMPATIBLE_FULL
= 18,
420 NAME_SAMPLE_TEXT
= 19,
421 NAME_POSTSCRIPT_CID
= 20
426 le_uint16 platformID
;
427 le_uint16 encodingID
;
428 le_uint16 languageID
;
435 typedef struct NameRecord NameRecord
;
442 le_uint16 stringOffset
;
443 NameRecord nameRecords
[ANY_NUMBER
];
447 typedef struct NAMETable NAMETable
;