1 2 /* 3 * Copyright 2011 Google Inc. 4 * 5 * Use of this source code is governed by a BSD-style license that can be 6 * found in the LICENSE file. 7 */ 8 9 #ifndef SkSfntUtils_DEFINED 10 #define SkSfntUtils_DEFINED 11 12 #include "SkFontHost.h" 13 14 struct SkSfntTable_head { 15 SkFixed fVersion; 16 SkFixed fRevision; 17 uint32_t fCheckSumAdjustment; 18 uint32_t fMagicNumber; 19 uint16_t fFlags; 20 uint16_t fUnitsPerEm; 21 Sk64 fDateCreated; 22 Sk64 fDateModified; 23 int16_t fXMin; 24 int16_t fYMin; 25 int16_t fXMax; 26 int16_t fYMax; 27 uint16_t fMacStyle; 28 uint16_t fLowestPPEM; 29 int16_t fFontDirectionHint; 30 int16_t fIndexToLocFormat; 31 int16_t fGlyphDataFormat; 32 }; 33 34 struct SkSfntTable_maxp { 35 SkFixed fVersion; 36 uint16_t fNumGlyphs; 37 uint16_t fMaxPoints; 38 uint16_t fMaxContours; 39 uint16_t fMaxComponentPoints; 40 uint16_t fMaxComponentContours; 41 uint16_t fMaxZones; 42 uint16_t fMaxTwilightPoints; 43 uint16_t fMaxStorage; 44 uint16_t fMaxFunctionDefs; 45 uint16_t fMaxInstructionDefs; 46 uint16_t fMaxStackElements; 47 uint16_t fMaxSizeOfInstructions; 48 uint16_t fMaxComponentElements; 49 uint16_t fMaxComponentDepth; 50 }; 51 52 class SkSfntUtils { 53 public: 54 static bool ReadTable_head(SkFontID, SkSfntTable_head*); 55 static bool ReadTable_maxp(SkFontID, SkSfntTable_maxp*); 56 }; 57 58 #endif 59 60