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 ************************************************************************/ 
  15 #ifndef __FONTOBJECT_H 
  16 #define __FONTOBJECT_H 
  39     le_uint16       searchRange
; 
  40     le_uint16       entrySelector
; 
  42     DirectoryEntry  tableDirectory
[ANY_NUMBER
]; 
  46 struct CMAPEncodingSubtableHeader
 
  49     le_uint16   platformSpecificID
; 
  50     le_uint32   encodingOffset
; 
  56     le_uint16   numberSubtables
; 
  57     CMAPEncodingSubtableHeader encodingSubtableHeaders
[ANY_NUMBER
]; 
  60 struct CMAPEncodingSubtable
 
  67 struct CMAPFormat0Encoding 
: CMAPEncodingSubtable
 
  69     le_uint8    glyphIndexArray
[256]; 
  72 struct CMAPFormat2Subheader
 
  77     le_uint16   idRangeOffset
; 
  80 struct CMAPFormat2Encoding 
: CMAPEncodingSubtable
 
  82     le_uint16  subHeadKeys
[256]; 
  83     CMAPFormat2Subheader subheaders
[ANY_NUMBER
]; 
  86 struct CMAPFormat4Encoding 
: CMAPEncodingSubtable
 
  89     le_uint16   searchRange
; 
  90     le_uint16   entrySelector
; 
  92     le_uint16   endCodes
[ANY_NUMBER
]; 
  93 //  le_uint16   reservedPad; 
  94 //  le_uint16   startCodes[ANY_NUMBER]; 
  95 //  le_uint16   idDelta[ANY_NUMBER]; 
  96 //  le_uint16   idRangeOffset[ANY_NUMBER]; 
  97 //  le_uint16   glyphIndexArray[ANY_NUMBER]; 
 100 struct CMAPFormat6Encoding 
: CMAPEncodingSubtable
 
 103     le_uint16   entryCount
; 
 104     le_uint16   glyphIndexArray
[ANY_NUMBER
]; 
 107 typedef le_int32 fixed
; 
 119     le_uint32   checksumAdjustment
; 
 120     le_uint32   magicNumber
; 
 122     le_uint16   unitsPerEm
; 
 129     le_int16    lowestRecPPEM
; 
 130     le_int16    fontDirectionHint
; 
 131     le_int16    indexToLocFormat
; 
 132     le_int16    glyphDataFormat
; 
 140     le_uint16   maxContours
; 
 141     le_uint16   maxComponentPoints
; 
 142     le_uint16   maxComponentContours
; 
 144     le_uint16   maxTwilightPoints
; 
 145     le_uint16   maxStorage
; 
 146     le_uint16   maxFunctionDefs
; 
 147     le_uint16   maxInstructionDefs
; 
 148     le_uint16   maxStackElements
; 
 149     le_uint16   maxSizeOfInstructions
; 
 150     le_uint16   maxComponentElements
; 
 151     le_uint16   maxComponentDepth
; 
 160     le_uint16   advanceWidthMax
; 
 161     le_int16    minLeftSideBearing
; 
 162     le_int16    minRightSideBearing
; 
 164     le_int16    caretSlopeRise
; 
 165     le_int16    caretSlopeRun
; 
 166     le_int16    caretOffset
; 
 171     le_int16    metricDataFormat
; 
 172     le_uint16   numOfLongHorMetrics
; 
 177     le_uint16   advanceWidth
; 
 178     le_int16    leftSideBearing
; 
 183     LongHorMetric hMetrics
[ANY_NUMBER
];        // ANY_NUMBER = numOfLongHorMetrics from hhea table 
 184 //  le_int16      leftSideBearing[ANY_NUMBER]; // ANY_NUMBER = numGlyphs - numOfLongHorMetrics 
 190     FontObject(char *fontName
); 
 193     void *readTable(LETag tag
, le_uint32 
*length
); 
 194     void deleteTable(void *table
); 
 196     LEGlyphID 
unicodeToGlyph(LEUnicode32 unicode
); 
 199     le_uint32 
unicodesToGlyphs(LEUnicode 
*chars
, le_uint32 nChars
, LEGlyphID 
*glyphs
, 
 200         le_uint32 
*charIndices
, le_bool rightToLeft
); 
 203     le_uint16 
getUnitsPerEM(); 
 205     le_uint16 
getGlyphAdvance(LEGlyphID glyph
); 
 210     DirectoryEntry 
*findTable(LETag tag
); 
 211     CMAPEncodingSubtable 
*findCMAP(le_uint16 platformID
, le_uint16 platformSpecificID
); 
 212     void initUnicodeCMAP(); 
 214     SFNTDirectory 
*directory
; 
 216     le_uint16 searchRange
; 
 217     le_uint16 entrySelector
; 
 218     le_uint16 rangeShift
; 
 220     CMAPTable 
*cmapTable
; 
 221     le_uint16 cmSegCount
; 
 222     le_uint16 cmSearchRange
; 
 223     le_uint16 cmEntrySelector
; 
 224     le_uint16 cmRangeShift
; 
 225     le_uint16 
*cmEndCodes
; 
 226     le_uint16 
*cmStartCodes
; 
 227     le_uint16 
*cmIdDelta
; 
 228     le_uint16 
*cmIdRangeOffset
; 
 230     HEADTable 
*headTable
; 
 232     HMTXTable 
*hmtxTable
; 
 234     le_uint16 numOfLongHorMetrics
;