skia2/include/utils/SkSfntUtils.h
reed@android.com 9781ca5866 add SkSfntUtils to parse some known truetype tables
add comments and cleanup to count_tables in SkFontHost_tables.cpp
fix transparency bug in gifs
use (alpha+1) for blending in srcover mode, to ensure opaque results



git-svn-id: http://skia.googlecode.com/svn/trunk@155 2bbb7eff-a529-9590-31e7-b0007b416f81
2009-04-14 14:28:22 +00:00

53 lines
1.3 KiB
C++

#ifndef SkSfntUtils_DEFINED
#define SkSfntUtils_DEFINED
#include "SkFontHost.h"
struct SkSfntTable_head {
SkFixed fVersion;
SkFixed fRevision;
uint32_t fCheckSumAdjustment;
uint32_t fMagicNumber;
uint16_t fFlags;
uint16_t fUnitsPerEm;
Sk64 fDateCreated;
Sk64 fDateModified;
int16_t fXMin;
int16_t fYMin;
int16_t fXMax;
int16_t fYMax;
uint16_t fMacStyle;
uint16_t fLowestPPEM;
int16_t fFontDirectionHint;
int16_t fIndexToLocFormat;
int16_t fGlyphDataFormat;
};
struct SkSfntTable_maxp {
SkFixed fVersion;
uint16_t fNumGlyphs;
uint16_t fMaxPoints;
uint16_t fMaxContours;
uint16_t fMaxComponentPoints;
uint16_t fMaxComponentContours;
uint16_t fMaxZones;
uint16_t fMaxTwilightPoints;
uint16_t fMaxStorage;
uint16_t fMaxFunctionDefs;
uint16_t fMaxInstructionDefs;
uint16_t fMaxStackElements;
uint16_t fMaxSizeOfInstructions;
uint16_t fMaxComponentElements;
uint16_t fMaxComponentDepth;
};
class SkSfntUtils {
public:
static bool ReadTable_head(SkFontID, SkSfntTable_head*);
static bool ReadTable_maxp(SkFontID, SkSfntTable_maxp*);
};
#endif