1 /***************************************************************************
3 * © 2016 and later: Unicode, Inc. and others.
4 * License & terms of use: http://www.unicode.org/copyright.html#License
6 ****************************************************************************/
7 /***************************************************************************
9 * Copyright (C) 1998-2013, International Business Machines
10 * Corporation and others. All Rights Reserved.
12 ************************************************************************/
17 #include "layout/LETypes.h"
34 typedef struct DirectoryEntry DirectoryEntry
;
41 le_uint16 searchRange
;
42 le_uint16 entrySelector
;
44 DirectoryEntry tableDirectory
[ANY_NUMBER
];
48 typedef struct SFNTDirectory SFNTDirectory
;
52 struct CMAPEncodingSubtableHeader
55 le_uint16 platformSpecificID
;
56 le_uint32 encodingOffset
;
60 typedef struct CMAPEncodingSubtableHeader CMAPEncodingSubtableHeader
;
66 le_uint16 numberSubtables
;
67 CMAPEncodingSubtableHeader encodingSubtableHeaders
[ANY_NUMBER
];
71 typedef struct CMAPTable CMAPTable
;
74 struct CMAPEncodingSubtable
82 typedef struct CMAPEncodingSubtable CMAPEncodingSubtable
;
86 struct CMAPFormat0Encoding
: CMAPEncodingSubtable
88 le_uint8 glyphIndexArray
[256];
91 struct CMAPFormat0Encoding
93 CMAPEncodingSubtable base
;
95 le_uint8 glyphIndexArray
[256];
98 typedef struct CMAPFormat0Encoding CMAPFormat0Encoding
;
101 struct CMAPFormat2Subheader
104 le_uint16 entryCount
;
106 le_uint16 idRangeOffset
;
110 typedef struct CMAPFormat2Subheader CMAPFormat2Subheader
;
114 struct CMAPFormat2Encoding
: CMAPEncodingSubtable
116 le_uint16 subHeadKeys
[256];
117 CMAPFormat2Subheader subheaders
[ANY_NUMBER
];
120 struct CMAPFormat2Encoding
122 CMAPEncodingSubtable base
;
124 le_uint16 subHeadKeys
[256];
125 CMAPFormat2Subheader subheaders
[ANY_NUMBER
];
128 typedef struct CMAPFormat2Encoding CMAPFormat2Encoding
;
132 struct CMAPFormat4Encoding
: CMAPEncodingSubtable
134 le_uint16 segCountX2
;
135 le_uint16 searchRange
;
136 le_uint16 entrySelector
;
137 le_uint16 rangeShift
;
138 le_uint16 endCodes
[ANY_NUMBER
];
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];
148 struct CMAPFormat4Encoding
150 CMAPEncodingSubtable base
;
152 le_uint16 segCountX2
;
153 le_uint16 searchRange
;
154 le_uint16 entrySelector
;
155 le_uint16 rangeShift
;
156 le_uint16 endCodes
[ANY_NUMBER
];
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];
166 typedef struct CMAPFormat4Encoding CMAPFormat4Encoding
;
170 struct CMAPFormat6Encoding
: CMAPEncodingSubtable
173 le_uint16 entryCount
;
174 le_uint16 glyphIndexArray
[ANY_NUMBER
];
177 struct CMAPFormat6Encoding
179 CMAPEncodingSubtable base
;
182 le_uint16 entryCount
;
183 le_uint16 glyphIndexArray
[ANY_NUMBER
];
186 typedef struct CMAPFormat6Encoding CMAPFormat6Encoding
;
189 struct CMAPEncodingSubtable32
197 typedef struct CMAPEncodingSubtable32 CMAPEncodingSubtable32
;
202 le_uint32 startCharCode
;
203 le_uint32 endCharCode
;
204 le_uint32 startGlyphCode
;
208 typedef struct CMAPGroup CMAPGroup
;
212 struct CMAPFormat8Encoding
: CMAPEncodingSubtable32
214 le_uint32 is32
[65536/32];
216 CMAPGroup groups
[ANY_NUMBER
];
219 struct CMAPFormat8Encoding
221 CMAPEncodingSubtable32 base
;
223 le_uint32 is32
[65536/32];
225 CMAPGroup groups
[ANY_NUMBER
];
228 typedef struct CMAPFormat8Encoding CMAPFormat8Encoding
;
232 struct CMAPFormat10Encoding
: CMAPEncodingSubtable32
234 le_uint32 startCharCode
;
235 le_uint32 numCharCodes
;
236 le_uint16 glyphs
[ANY_NUMBER
];
239 struct CMAPFormat10Encoding
241 CMAPEncodingSubtable32 base
;
243 le_uint32 startCharCode
;
244 le_uint32 numCharCodes
;
245 le_uint16 glyphs
[ANY_NUMBER
];
248 typedef struct CMAPFormat10Encoding CMAPFormat10Encoding
;
252 struct CMAPFormat12Encoding
: CMAPEncodingSubtable32
255 CMAPGroup groups
[ANY_NUMBER
];
258 struct CMAPFormat12Encoding
260 CMAPEncodingSubtable32 base
;
263 CMAPGroup groups
[ANY_NUMBER
];
266 typedef struct CMAPFormat12Encoding CMAPFormat12Encoding
;
269 typedef le_int32 fixed
;
278 typedef struct BigDate BigDate
;
285 le_uint32 checksumAdjustment
;
286 le_uint32 magicNumber
;
288 le_uint16 unitsPerEm
;
295 le_int16 lowestRecPPEM
;
296 le_int16 fontDirectionHint
;
297 le_int16 indexToLocFormat
;
298 le_int16 glyphDataFormat
;
302 typedef struct HEADTable HEADTable
;
310 le_uint16 maxContours
;
311 le_uint16 maxComponentPoints
;
312 le_uint16 maxComponentContours
;
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
;
325 typedef struct MAXPTable MAXPTable
;
334 le_uint16 advanceWidthMax
;
335 le_int16 minLeftSideBearing
;
336 le_int16 minRightSideBearing
;
338 le_int16 caretSlopeRise
;
339 le_int16 caretSlopeRun
;
340 le_int16 caretOffset
;
345 le_int16 metricDataFormat
;
346 le_uint16 numOfLongHorMetrics
;
350 typedef struct HHEATable HHEATable
;
355 le_uint16 advanceWidth
;
356 le_int16 leftSideBearing
;
360 typedef struct LongHorMetric LongHorMetric
;
365 LongHorMetric hMetrics
[ANY_NUMBER
]; /* ANY_NUMBER = numOfLongHorMetrics from hhea table */
366 /* le_int16 leftSideBearing[ANY_NUMBER]; ANY_NUMBER = numGlyphs - numOfLongHorMetrics */
370 typedef struct HMTXTable HMTXTable
;
375 PLATFORM_UNICODE
= 0,
376 PLATFORM_MACINTOSH
= 1,
378 PLATFORM_MICROSOFT
= 3,
382 enum MacintoshEncodingID
387 enum MacintoshLanguageID
389 MACINTOSH_ENGLISH
= 0
392 enum MicrosoftEncodingID
394 MICROSOFT_UNICODE_BMP
= 1,
395 MICROSOFT_UNICODE_FULL
= 10
398 enum MicrosoftLanguageID
400 MICROSOFT_ENGLISH
= 0x409
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,
413 NAME_MANUFACTURER
= 8,
415 NAME_DESCRIPTION
= 10,
416 NAME_VENDOR_URL
= 11,
417 NAME_DESIGNER_URL
= 12,
418 NAME_LICENSE_DESCRIPTION
= 13,
419 NAME_LICENSE_URL
= 14,
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
430 le_uint16 platformID
;
431 le_uint16 encodingID
;
432 le_uint16 languageID
;
439 typedef struct NameRecord NameRecord
;
446 le_uint16 stringOffset
;
447 NameRecord nameRecords
[ANY_NUMBER
];
451 typedef struct NAMETable NAMETable
;