1 /***************************************************************************
3 * Copyright (C) 1998-2013, International Business Machines
4 * Corporation and others. All Rights Reserved.
6 ************************************************************************/
11 #include "layout/LETypes.h"
28 typedef struct DirectoryEntry DirectoryEntry
;
35 le_uint16 searchRange
;
36 le_uint16 entrySelector
;
38 DirectoryEntry tableDirectory
[ANY_NUMBER
];
42 typedef struct SFNTDirectory SFNTDirectory
;
46 struct CMAPEncodingSubtableHeader
49 le_uint16 platformSpecificID
;
50 le_uint32 encodingOffset
;
54 typedef struct CMAPEncodingSubtableHeader CMAPEncodingSubtableHeader
;
60 le_uint16 numberSubtables
;
61 CMAPEncodingSubtableHeader encodingSubtableHeaders
[ANY_NUMBER
];
65 typedef struct CMAPTable CMAPTable
;
68 struct CMAPEncodingSubtable
76 typedef struct CMAPEncodingSubtable CMAPEncodingSubtable
;
80 struct CMAPFormat0Encoding
: CMAPEncodingSubtable
82 le_uint8 glyphIndexArray
[256];
85 struct CMAPFormat0Encoding
87 CMAPEncodingSubtable base
;
89 le_uint8 glyphIndexArray
[256];
92 typedef struct CMAPFormat0Encoding CMAPFormat0Encoding
;
95 struct CMAPFormat2Subheader
100 le_uint16 idRangeOffset
;
104 typedef struct CMAPFormat2Subheader CMAPFormat2Subheader
;
108 struct CMAPFormat2Encoding
: CMAPEncodingSubtable
110 le_uint16 subHeadKeys
[256];
111 CMAPFormat2Subheader subheaders
[ANY_NUMBER
];
114 struct CMAPFormat2Encoding
116 CMAPEncodingSubtable base
;
118 le_uint16 subHeadKeys
[256];
119 CMAPFormat2Subheader subheaders
[ANY_NUMBER
];
122 typedef struct CMAPFormat2Encoding CMAPFormat2Encoding
;
126 struct CMAPFormat4Encoding
: CMAPEncodingSubtable
128 le_uint16 segCountX2
;
129 le_uint16 searchRange
;
130 le_uint16 entrySelector
;
131 le_uint16 rangeShift
;
132 le_uint16 endCodes
[ANY_NUMBER
];
134 le_uint16 reservedPad;
135 le_uint16 startCodes[ANY_NUMBER];
136 le_uint16 idDelta[ANY_NUMBER];
137 le_uint16 idRangeOffset[ANY_NUMBER];
138 le_uint16 glyphIndexArray[ANY_NUMBER];
142 struct CMAPFormat4Encoding
144 CMAPEncodingSubtable base
;
146 le_uint16 segCountX2
;
147 le_uint16 searchRange
;
148 le_uint16 entrySelector
;
149 le_uint16 rangeShift
;
150 le_uint16 endCodes
[ANY_NUMBER
];
152 // le_uint16 reservedPad;
153 // le_uint16 startCodes[ANY_NUMBER];
154 // le_uint16 idDelta[ANY_NUMBER];
155 // le_uint16 idRangeOffset[ANY_NUMBER];
156 // le_uint16 glyphIndexArray[ANY_NUMBER];
160 typedef struct CMAPFormat4Encoding CMAPFormat4Encoding
;
164 struct CMAPFormat6Encoding
: CMAPEncodingSubtable
167 le_uint16 entryCount
;
168 le_uint16 glyphIndexArray
[ANY_NUMBER
];
171 struct CMAPFormat6Encoding
173 CMAPEncodingSubtable base
;
176 le_uint16 entryCount
;
177 le_uint16 glyphIndexArray
[ANY_NUMBER
];
180 typedef struct CMAPFormat6Encoding CMAPFormat6Encoding
;
183 struct CMAPEncodingSubtable32
191 typedef struct CMAPEncodingSubtable32 CMAPEncodingSubtable32
;
196 le_uint32 startCharCode
;
197 le_uint32 endCharCode
;
198 le_uint32 startGlyphCode
;
202 typedef struct CMAPGroup CMAPGroup
;
206 struct CMAPFormat8Encoding
: CMAPEncodingSubtable32
208 le_uint32 is32
[65536/32];
210 CMAPGroup groups
[ANY_NUMBER
];
213 struct CMAPFormat8Encoding
215 CMAPEncodingSubtable32 base
;
217 le_uint32 is32
[65536/32];
219 CMAPGroup groups
[ANY_NUMBER
];
222 typedef struct CMAPFormat8Encoding CMAPFormat8Encoding
;
226 struct CMAPFormat10Encoding
: CMAPEncodingSubtable32
228 le_uint32 startCharCode
;
229 le_uint32 numCharCodes
;
230 le_uint16 glyphs
[ANY_NUMBER
];
233 struct CMAPFormat10Encoding
235 CMAPEncodingSubtable32 base
;
237 le_uint32 startCharCode
;
238 le_uint32 numCharCodes
;
239 le_uint16 glyphs
[ANY_NUMBER
];
242 typedef struct CMAPFormat10Encoding CMAPFormat10Encoding
;
246 struct CMAPFormat12Encoding
: CMAPEncodingSubtable32
249 CMAPGroup groups
[ANY_NUMBER
];
252 struct CMAPFormat12Encoding
254 CMAPEncodingSubtable32 base
;
257 CMAPGroup groups
[ANY_NUMBER
];
260 typedef struct CMAPFormat12Encoding CMAPFormat12Encoding
;
263 typedef le_int32 fixed
;
272 typedef struct BigDate BigDate
;
279 le_uint32 checksumAdjustment
;
280 le_uint32 magicNumber
;
282 le_uint16 unitsPerEm
;
289 le_int16 lowestRecPPEM
;
290 le_int16 fontDirectionHint
;
291 le_int16 indexToLocFormat
;
292 le_int16 glyphDataFormat
;
296 typedef struct HEADTable HEADTable
;
304 le_uint16 maxContours
;
305 le_uint16 maxComponentPoints
;
306 le_uint16 maxComponentContours
;
308 le_uint16 maxTwilightPoints
;
309 le_uint16 maxStorage
;
310 le_uint16 maxFunctionDefs
;
311 le_uint16 maxInstructionDefs
;
312 le_uint16 maxStackElements
;
313 le_uint16 maxSizeOfInstructions
;
314 le_uint16 maxComponentElements
;
315 le_uint16 maxComponentDepth
;
319 typedef struct MAXPTable MAXPTable
;
328 le_uint16 advanceWidthMax
;
329 le_int16 minLeftSideBearing
;
330 le_int16 minRightSideBearing
;
332 le_int16 caretSlopeRise
;
333 le_int16 caretSlopeRun
;
334 le_int16 caretOffset
;
339 le_int16 metricDataFormat
;
340 le_uint16 numOfLongHorMetrics
;
344 typedef struct HHEATable HHEATable
;
349 le_uint16 advanceWidth
;
350 le_int16 leftSideBearing
;
354 typedef struct LongHorMetric LongHorMetric
;
359 LongHorMetric hMetrics
[ANY_NUMBER
]; /* ANY_NUMBER = numOfLongHorMetrics from hhea table */
360 /* le_int16 leftSideBearing[ANY_NUMBER]; ANY_NUMBER = numGlyphs - numOfLongHorMetrics */
364 typedef struct HMTXTable HMTXTable
;
369 PLATFORM_UNICODE
= 0,
370 PLATFORM_MACINTOSH
= 1,
372 PLATFORM_MICROSOFT
= 3,
376 enum MacintoshEncodingID
381 enum MacintoshLanguageID
383 MACINTOSH_ENGLISH
= 0
386 enum MicrosoftEncodingID
388 MICROSOFT_UNICODE_BMP
= 1,
389 MICROSOFT_UNICODE_FULL
= 10
392 enum MicrosoftLanguageID
394 MICROSOFT_ENGLISH
= 0x409
399 NAME_COPYRIGHT_NOTICE
= 0,
400 NAME_FONT_FAMILY
= 1,
401 NAME_FONT_SUB_FAMILY
= 2,
402 NAME_UNIQUE_FONT_ID
= 3,
403 NAME_FULL_FONT_NAME
= 4,
404 NAME_VERSION_STRING
= 5,
405 NAME_POSTSCRIPT_NAME
= 6,
407 NAME_MANUFACTURER
= 8,
409 NAME_DESCRIPTION
= 10,
410 NAME_VENDOR_URL
= 11,
411 NAME_DESIGNER_URL
= 12,
412 NAME_LICENSE_DESCRIPTION
= 13,
413 NAME_LICENSE_URL
= 14,
415 NAME_PREFERRED_FAMILY
= 16,
416 NAME_PREFERRED_SUB_FAMILY
= 17,
417 NAME_COMPATIBLE_FULL
= 18,
418 NAME_SAMPLE_TEXT
= 19,
419 NAME_POSTSCRIPT_CID
= 20
424 le_uint16 platformID
;
425 le_uint16 encodingID
;
426 le_uint16 languageID
;
433 typedef struct NameRecord NameRecord
;
440 le_uint16 stringOffset
;
441 NameRecord nameRecords
[ANY_NUMBER
];
445 typedef struct NAMETable NAMETable
;