ref: 3582b9cc27bf2a83800c00b4a84873037e99642d
dir: /plan9/otf.h/
#line 1 "otf.h.in" /* this file is generated. do not modify. */ typedef struct Otf Otf; #ifdef __unix__ #include <stdint.h> typedef int8_t s8int; typedef int16_t s16int; typedef int32_t s32int; typedef int64_t s64int; typedef uint8_t u8int; typedef uint16_t u16int; typedef uint32_t u32int; typedef uint64_t u64int; typedef uint32_t Rune; char *otferrstr(void); #else #pragma incomplete Otf #endif typedef struct Otfile Otfile; struct Otfile { void *aux; int (*seek)(void *aux, int off, int whence); int (*read)(void *aux, void *dst, int sz); int (*write)(void *aux, const void *src, int sz); int (*print)(void *aux, const char *fmt, ...); }; typedef struct RuneMapper RuneMapper; struct RuneMapper { int (*rune2glyph)(void *aux,Rune r); Rune (*glyph2rune)(void *aux, int g); void *aux; }; #define NoRune (~(Rune)0) enum { GLYPH_EMPTY, GLYPH_SIMPLE, GLYPH_COMPONENT, GLYPH_BITMAP, }; typedef struct BitmapGlyph BitmapGlyph; typedef struct EbdtComponent EbdtComponent; struct BitmapGlyph { int bitDepth; int format; int offset; int size; int pitchBits; int ppemX; int ppemY; int numComponents; EbdtComponent *components; u8int image[]; }; typedef struct ComponentGlyph ComponentGlyph; enum { CGLYPH_FL_SIGNED_XY = 1<<1, CGLYPH_FL_ROUND_TO_GRID_XY = 1<<2, CGLYPH_FL_MORE_COMPONENTS = 1<<5, CGLYPH_FL_SCALE_XY = 1<<6, CGLYPH_FL_2X2_TRANSFORM = 1<<7, CGLYPH_FL_INSTRUCTIONS = 1<<8, CGLYPH_FL_METRICS = 1<<9, CGLYPH_FL_SCALED_COMPONENT_OFFSET = 1<<11, }; struct ComponentGlyph { u16int flags; u16int glyphIndex; union { int arg1; int dx; }; union { int arg2; int dy; }; float scaleX, scale01, scale10, scaleY; u16int numInstr; u8int *instr; ComponentGlyph *next; }; typedef struct Point Point; struct Point { int x; int y; int onCurve; }; typedef struct SimpleGlyph SimpleGlyph; struct SimpleGlyph { int numEndPtsOfContours; u16int *endPtsOfContours; u16int instructionLength; u8int *instructions; int numPoints; Point *points; }; extern int indentΔ; Otf *otfopen(Otfile *in); void otfprint(Otf *o, Otfile *out, int indent); void otfclose(Otf *o); /* * FIXME this API *will* change, maybe not even once. * atm it's just to get things going, for a start. */ typedef struct Glyf Glyf; typedef struct GlyfImage GlyfImage; typedef struct RasterOpts RasterOpts; typedef struct SubPx SubPx; enum { GLYF_FMT_GREY_8, GLYF_FMT_RGB_24, }; enum { LCD_ORDER_RGB, LCD_ORDER_BGR, }; struct GlyfImage { int w; int h; int baseline; int fmt; u8int b[]; }; struct SubPx { struct { u8int *c; int nc; }fir; int lcdorder; int lcdvert; u8int *buf; int bufsz; }; struct RasterOpts { double ppemX; double ppemY; SubPx *subpx; }; int otfglyfnum(Otf *o); int otfrune2glyph(Otf *o, Rune r); Rune otfglyph2rune(Otf *o, int g); Glyf *otfglyf(Otf *o, int index, RasterOpts *opts); GlyfImage *otfdrawglyf(Otf *o, Glyf *g, RasterOpts *opts); typedef struct SubHeader SubHeader; typedef struct MapGroup MapGroup; typedef struct SubtableCmap0 SubtableCmap0; typedef struct SubtableCmap2 SubtableCmap2; typedef struct SubtableCmap4 SubtableCmap4; typedef struct SubtableCmap6 SubtableCmap6; typedef struct SubtableCmap8 SubtableCmap8; typedef struct SubtableCmap10 SubtableCmap10; typedef struct SubtableCmap12or13 SubtableCmap12or13; typedef struct UnicodeRange UnicodeRange; typedef struct DefaultUVS DefaultUVS; typedef struct UVSMapping UVSMapping; typedef struct NonDefaultUVS NonDefaultUVS; typedef struct VariationSelector VariationSelector; typedef struct SubtableCmap14 SubtableCmap14; typedef struct SubtableCmap SubtableCmap; typedef struct EncodingRecord EncodingRecord; typedef struct TableCmap TableCmap; typedef struct TableHead TableHead; typedef struct TableHhea TableHhea; typedef struct EbdtComponent EbdtComponent; typedef struct Glyf Glyf; typedef struct LongHorMetric LongHorMetric; typedef struct TableMaxp TableMaxp; typedef struct TableHmtx TableHmtx; typedef struct TablePost TablePost; typedef struct NameRecord NameRecord; typedef struct LangTagRecord LangTagRecord; typedef struct TableName TableName; typedef struct BigGlyphMetrics BigGlyphMetrics; typedef struct SmallGlyphMetrics SmallGlyphMetrics; typedef struct SbitLineMetrics SbitLineMetrics; typedef struct IndexSubtable1 IndexSubtable1; typedef struct IndexSubtable2 IndexSubtable2; typedef struct IndexSubtable3 IndexSubtable3; typedef struct GlyphIdOffsetPair GlyphIdOffsetPair; typedef struct IndexSubtable4 IndexSubtable4; typedef struct IndexSubtable5 IndexSubtable5; typedef struct IndexSubtable IndexSubtable; typedef struct IndexSubtableRecord IndexSubtableRecord; typedef struct BitmapSize BitmapSize; typedef struct TableEBDT TableEBDT; typedef struct TableEBLC TableEBLC; typedef struct AttachList AttachList; typedef struct AttachPoint AttachPoint; typedef struct LigCaretList LigCaretList; typedef struct LigGlyph LigGlyph; typedef struct CaretValue CaretValue; typedef struct ValueRecord ValueRecord; typedef struct SinglePos SinglePos; typedef struct TableGDEF TableGDEF; typedef struct LangSys LangSys; typedef struct LangSysRecord LangSysRecord; typedef struct Script Script; typedef struct ScriptRecord ScriptRecord; typedef struct ScriptList ScriptList; typedef struct Feature Feature; typedef struct FeatureRecord FeatureRecord; typedef struct FeatureList FeatureList; typedef struct SequenceLookup SequenceLookup; typedef struct ChainedSequenceRule ChainedSequenceRule; typedef struct ChainedSequenceRuleSet ChainedSequenceRuleSet; typedef struct ChainedSequenceContextFormat1 ChainedSequenceContextFormat1; typedef struct ChainedClassSequenceRuleSet ChainedClassSequenceRuleSet; typedef struct ChainedSequenceContextFormat2 ChainedSequenceContextFormat2; typedef struct ChainedSequenceContextFormat3 ChainedSequenceContextFormat3; typedef struct ChainedSequenceContext ChainedSequenceContext; typedef struct PairValue PairValue; typedef struct PairSet PairSet; typedef struct PairPosFormat1 PairPosFormat1; typedef struct Class2 Class2; typedef struct Class1 Class1; typedef struct PairPosFormat2 PairPosFormat2; typedef struct PairPos PairPos; typedef struct EntryExit EntryExit; typedef struct CursivePos CursivePos; typedef struct Lookup Lookup; typedef struct LookupList LookupList; typedef struct TableGPOS TableGPOS; typedef struct TableGSUB TableGSUB; typedef struct MathValueRecord MathValueRecord; typedef struct MathConstants MathConstants; typedef struct MathItalicsCorrectionInfo MathItalicsCorrectionInfo; typedef struct MathTopAccentAttachment MathTopAccentAttachment; typedef struct MathKernInfoRecord MathKernInfoRecord; typedef struct MathKernInfo MathKernInfo; typedef struct MathKern MathKern; typedef struct Coverage1 Coverage1; typedef struct RangeRecord RangeRecord; typedef struct Coverage2 Coverage2; typedef struct Coverage Coverage; typedef struct MathGlyphVariantRecord MathGlyphVariantRecord; typedef struct GlyphPart GlyphPart; typedef struct GlyphAssembly GlyphAssembly; typedef struct MathGlyphConstruction MathGlyphConstruction; typedef struct MathVariants MathVariants; typedef struct MathGlyphInfo MathGlyphInfo; typedef struct TableMATH TableMATH; typedef struct KernPair KernPair; typedef struct KernSubtable0 KernSubtable0; typedef struct KernClass KernClass; typedef struct KernSubtable2 KernSubtable2; typedef struct KernSubtable KernSubtable; typedef struct TableKern TableKern; typedef struct TableLoca TableLoca; typedef struct GlyphData GlyphData; typedef struct SbixStrike SbixStrike; typedef struct TableSbix TableSbix; typedef struct VariationAxisRecord VariationAxisRecord; typedef struct UserTuple UserTuple; typedef struct InstanceRecord InstanceRecord; typedef struct AxisInstances AxisInstances; typedef struct TableFvar TableFvar; typedef struct RegionAxisCoordinates RegionAxisCoordinates; typedef struct VariationRegion VariationRegion; typedef struct VariationRegionList VariationRegionList; typedef struct ItemVariationData ItemVariationData; typedef struct ItemVariationStore ItemVariationStore; typedef struct DeltaSetIndexMap DeltaSetIndexMap; typedef struct TableHVAR TableHVAR; typedef struct TableFFTM TableFFTM; typedef struct SignatureBlock1 SignatureBlock1; typedef struct SignatureRecord SignatureRecord; typedef struct TableDSIG TableDSIG; typedef struct AxisRecord AxisRecord; typedef struct AxisValueTable1 AxisValueTable1; typedef struct AxisValueTable2 AxisValueTable2; typedef struct AxisValueTable3 AxisValueTable3; typedef struct AxisValue AxisValue; typedef struct AxisValueTable4 AxisValueTable4; typedef struct AxisValueTable AxisValueTable; typedef struct DesignAxes DesignAxes; typedef struct TableSTAT TableSTAT; typedef struct GaspRange GaspRange; typedef struct TableGasp TableGasp; typedef struct Tuple Tuple; typedef struct TupleVariationHeader TupleVariationHeader; typedef struct GlyphVariationData GlyphVariationData; typedef struct TableGvar TableGvar; typedef struct AxisValueMap AxisValueMap; typedef struct SegmentMaps SegmentMaps; typedef struct TableAvar TableAvar; typedef struct TableOS∕2 TableOS∕2; typedef struct TableRecord TableRecord; typedef struct TableDirectory TableDirectory; struct SubHeader { u16int firstCode; u16int entryCode; s16int idDelta; u16int idRangeOffset; }; int read_SubHeader(Otf *o, SubHeader *v); void print_SubHeader(Otfile *f, int indent, Otf *o, SubHeader *v); struct MapGroup { u32int startCharCode; u32int endCharCode; u32int startGlyphID; }; int read_MapGroup(Otf *o, MapGroup *v); void print_MapGroup(Otfile *f, int indent, Otf *o, MapGroup *v); struct SubtableCmap0 { u16int length; u16int language; u8int glyphIdArray[256]; }; int read_SubtableCmap0(Otf *o, SubtableCmap0 *v); void print_SubtableCmap0(Otfile *f, int indent, Otf *o, SubtableCmap0 *v); struct SubtableCmap2 { u16int length; u16int language; }; int read_SubtableCmap2(Otf *o, SubtableCmap2 *v); void print_SubtableCmap2(Otfile *f, int indent, Otf *o, SubtableCmap2 *v); struct SubtableCmap4 { u16int length; u16int language; u16int segCountX2; u16int searchRange; u16int entrySelector; u16int rangeShift; u16int *endCode; // u16int reservedPad; u16int *startCode; s16int *idDelta; s16int *idRangeOffset; u16int *glyphIdArray; }; int read_SubtableCmap4(Otf *o, SubtableCmap4 *v); void print_SubtableCmap4(Otfile *f, int indent, Otf *o, SubtableCmap4 *v); struct SubtableCmap6 { u16int length; u16int language; u16int firstCode; u16int entryCount; u16int *glyphIdArray; }; int read_SubtableCmap6(Otf *o, SubtableCmap6 *v); void print_SubtableCmap6(Otfile *f, int indent, Otf *o, SubtableCmap6 *v); struct SubtableCmap8 { u16int length; u16int language; u8int is32[8192]; u32int numGroups; MapGroup *groups; }; int read_SubtableCmap8(Otf *o, SubtableCmap8 *v); void print_SubtableCmap8(Otfile *f, int indent, Otf *o, SubtableCmap8 *v); struct SubtableCmap10 { u16int reserved; u32int length; u32int language; u32int startCharCode; u32int numChars; u16int *glyphIdArray; }; int read_SubtableCmap10(Otf *o, SubtableCmap10 *v); void print_SubtableCmap10(Otfile *f, int indent, Otf *o, SubtableCmap10 *v); struct SubtableCmap12or13 { u16int reserved; u32int length; u32int language; u32int numGroups; MapGroup *groups; }; int read_SubtableCmap12or13(Otf *o, SubtableCmap12or13 *v); void print_SubtableCmap12or13(Otfile *f, int indent, Otf *o, SubtableCmap12or13 *v); struct UnicodeRange { u32int startUnicodeValue; u8int additionalCount; }; int read_UnicodeRange(Otf *o, UnicodeRange *v); void print_UnicodeRange(Otfile *f, int indent, Otf *o, UnicodeRange *v); struct DefaultUVS { u32int numUnicodeValueRanges; UnicodeRange *ranges; }; int read_DefaultUVS(Otf *o, DefaultUVS *v); void print_DefaultUVS(Otfile *f, int indent, Otf *o, DefaultUVS *v); struct UVSMapping { u32int unicodeValue; u16int glyphID; }; int read_UVSMapping(Otf *o, UVSMapping *v); void print_UVSMapping(Otfile *f, int indent, Otf *o, UVSMapping *v); struct NonDefaultUVS { u32int numUVSMappings; UVSMapping *uvsMappings; }; int read_NonDefaultUVS(Otf *o, NonDefaultUVS *v); void print_NonDefaultUVS(Otfile *f, int indent, Otf *o, NonDefaultUVS *v); struct VariationSelector { u32int varSelector; u32int defaultUVSOffset; u32int nonDefaultUVSOffset; DefaultUVS *defaultUVS; NonDefaultUVS *nonDefaultUVS; }; int read_VariationSelector(Otf *o, VariationSelector *v); void print_VariationSelector(Otfile *f, int indent, Otf *o, VariationSelector *v); struct SubtableCmap14 { u32int length; u32int numVarSelectorRecords; VariationSelector *varSelector; }; int read_SubtableCmap14(Otf *o, SubtableCmap14 *v); void print_SubtableCmap14(Otfile *f, int indent, Otf *o, SubtableCmap14 *v); struct SubtableCmap { u16int format; SubtableCmap0 sub0; SubtableCmap2 sub2; SubtableCmap4 sub4; SubtableCmap6 sub6; SubtableCmap8 sub8; SubtableCmap10 sub10; SubtableCmap12or13 sub12or13; SubtableCmap14 sub14; }; int read_SubtableCmap(Otf *o, SubtableCmap *v); void print_SubtableCmap(Otfile *f, int indent, Otf *o, SubtableCmap *v); struct EncodingRecord { u16int platformID; u16int encodingID; u32int subtableOffset; SubtableCmap *subtable; }; int read_EncodingRecord(Otf *o, EncodingRecord *v); void print_EncodingRecord(Otfile *f, int indent, Otf *o, EncodingRecord *v); struct TableCmap { // u16int version; u16int numTables; EncodingRecord *encodingRecords; RuneMapper mappers[8]; int numMappers; }; int read_TableCmap(Otf *o, TableCmap *v); void print_TableCmap(Otfile *f, int indent, Otf *o, TableCmap *v); enum { // TableHead // flags HEAD_FL_BASELINE_Y_0 = 1<<0, HEAD_FL_LEFT_SIDEBEARING_X_0 = 1<<1, HEAD_FL_INSTR_DEP_POINT_SZ = 1<<2, HEAD_FL_FORCE_PPEM_INT = 1<<3, HEAD_FL_INSTR_ALT_ADVANCE_WIDTH = 1<<4, HEAD_FL_LOSSLESS = 1<<11, HEAD_FL_CONVERTED = 1<<12, HEAD_FL_CLEARTYPE = 1<<13, HEAD_FL_LAST_RESORT = 1<<14, }; struct TableHead { // u16int majorVersion; // u16int minorVersion; // double fontRevision; // u32int checksumAdjustment; // u32int magicNumber; u16int flags; u16int unitsPerEm; s64int created; s64int modified; s16int xMin; s16int yMin; s16int xMax; s16int yMax; u16int macStyle; u16int lowestRecPPEM; // s16int fontDirectionHint; s16int indexToLocFormat; // s16int glyphDataFormat; }; int read_TableHead(Otf *o, TableHead *v); void print_TableHead(Otfile *f, int indent, Otf *o, TableHead *v); struct TableHhea { u16int majorVersion; u16int minorVersion; s16int ascender; s16int descender; s16int lineGap; u16int advanceWidthMax; s16int minLeftSideBearing; s16int minRightSideBearing; s16int xMaxExtent; s16int caretSlopeRise; s16int caretSlopeRun; s16int caretOffset; // s16int reserved[4]; s16int metricDataFormat; u16int numberOfHMetrics; }; int read_TableHhea(Otf *o, TableHhea *v); void print_TableHhea(Otfile *f, int indent, Otf *o, TableHhea *v); struct EbdtComponent { u16int glyphID; s8int xOffset; s8int yOffset; }; int read_EbdtComponent(Otf *o, EbdtComponent *v); void print_EbdtComponent(Otfile *f, int indent, Otf *o, EbdtComponent *v); struct Glyf { s16int numberOfContours; s16int xMin; s16int yMin; s16int xMax; s16int yMax; int index; int type; union { ComponentGlyph *component; SimpleGlyph *simple; BitmapGlyph *bitmap; }; }; int read_Glyf(Otf *o, Glyf *v); void print_Glyf(Otfile *f, int indent, Otf *o, Glyf *v); struct LongHorMetric { u16int advanceWidth; s16int lsb; }; int read_LongHorMetric(Otf *o, LongHorMetric *v); void print_LongHorMetric(Otfile *f, int indent, Otf *o, LongHorMetric *v); struct TableMaxp { // u32int version; u16int numGlyphs; }; int read_TableMaxp(Otf *o, TableMaxp *v); void print_TableMaxp(Otfile *f, int indent, Otf *o, TableMaxp *v); struct TableHmtx { LongHorMetric *hMetrics; s16int *leftSideBearings; }; int read_TableHmtx(Otf *o, TableHmtx *v); void print_TableHmtx(Otfile *f, int indent, Otf *o, TableHmtx *v); struct TablePost { // u32int version; double italicAngle; s16int underlinePosition; s16int underlineThickness; u32int isFixedPitch; }; int read_TablePost(Otf *o, TablePost *v); void print_TablePost(Otfile *f, int indent, Otf *o, TablePost *v); struct NameRecord { u16int platformID; u16int encodingID; u16int languageID; u16int nameID; u16int stringLength; u16int stringOffset; char *string; }; int read_NameRecord(Otf *o, NameRecord *v); void print_NameRecord(Otfile *f, int indent, Otf *o, NameRecord *v); struct LangTagRecord { u16int length; u16int langTagOffset; char *langTag; }; int read_LangTagRecord(Otf *o, LangTagRecord *v); void print_LangTagRecord(Otfile *f, int indent, Otf *o, LangTagRecord *v); struct TableName { u16int version; u16int count; u16int storageOffset; NameRecord *nameRecord; u16int langTagCount; LangTagRecord *langTagRecord; }; int read_TableName(Otf *o, TableName *v); void print_TableName(Otfile *f, int indent, Otf *o, TableName *v); struct BigGlyphMetrics { u8int height; u8int width; s8int horiBearingX; s8int horiBearingY; u8int horiAdvance; s8int vertBearingX; s8int vertBearingY; u8int vertAdvance; }; int read_BigGlyphMetrics(Otf *o, BigGlyphMetrics *v); void print_BigGlyphMetrics(Otfile *f, int indent, Otf *o, BigGlyphMetrics *v); struct SmallGlyphMetrics { u8int height; u8int width; s8int bearingX; s8int bearingY; u8int advance; }; int read_SmallGlyphMetrics(Otf *o, SmallGlyphMetrics *v); void print_SmallGlyphMetrics(Otfile *f, int indent, Otf *o, SmallGlyphMetrics *v); struct SbitLineMetrics { s8int ascender; s8int descender; u8int widthMax; s8int caretSlopeNumerator; s8int caretSlopeDenumerator; s8int caretOffset; s8int minOriginSB; s8int minAdvanceSB; s8int maxBeforeBL; s8int minAfterBL; // s8int pad[2]; }; int read_SbitLineMetrics(Otf *o, SbitLineMetrics *v); void print_SbitLineMetrics(Otfile *f, int indent, Otf *o, SbitLineMetrics *v); struct IndexSubtable1 { u32int *sbitOffsets; }; int read_IndexSubtable1(Otf *o, IndexSubtable1 *v); void print_IndexSubtable1(Otfile *f, int indent, Otf *o, IndexSubtable1 *v); struct IndexSubtable2 { u32int imageSize; BigGlyphMetrics bigMetrics; }; int read_IndexSubtable2(Otf *o, IndexSubtable2 *v); void print_IndexSubtable2(Otfile *f, int indent, Otf *o, IndexSubtable2 *v); struct IndexSubtable3 { u16int *sbitOffsets; }; int read_IndexSubtable3(Otf *o, IndexSubtable3 *v); void print_IndexSubtable3(Otfile *f, int indent, Otf *o, IndexSubtable3 *v); struct GlyphIdOffsetPair { u16int glyphID; u16int sbitOffset; }; int read_GlyphIdOffsetPair(Otf *o, GlyphIdOffsetPair *v); void print_GlyphIdOffsetPair(Otfile *f, int indent, Otf *o, GlyphIdOffsetPair *v); struct IndexSubtable4 { u32int numGlyphs; GlyphIdOffsetPair *glyphArray; }; int read_IndexSubtable4(Otf *o, IndexSubtable4 *v); void print_IndexSubtable4(Otfile *f, int indent, Otf *o, IndexSubtable4 *v); struct IndexSubtable5 { u32int imageSize; BigGlyphMetrics bigMetrics; u32int numGlyphs; u16int *glyphIdArray; }; int read_IndexSubtable5(Otf *o, IndexSubtable5 *v); void print_IndexSubtable5(Otfile *f, int indent, Otf *o, IndexSubtable5 *v); struct IndexSubtable { u16int indexFormat; u16int imageFormat; u32int imageDataOffset; IndexSubtable1 sub1; IndexSubtable2 sub2; IndexSubtable3 sub3; IndexSubtable4 sub4; IndexSubtable5 sub5; }; int read_IndexSubtable(Otf *o, IndexSubtable *v); void print_IndexSubtable(Otfile *f, int indent, Otf *o, IndexSubtable *v); struct IndexSubtableRecord { u16int firstGlyphIndex; u16int lastGlyphIndex; u32int indexSubtableOffset; IndexSubtable *indexSubtable; }; int read_IndexSubtableRecord(Otf *o, IndexSubtableRecord *v); void print_IndexSubtableRecord(Otfile *f, int indent, Otf *o, IndexSubtableRecord *v); enum { // BitmapSize // flags BITMAPSIZE_FL_HORIZONTAL_METRICS = 1<<0, BITMAPSIZE_FL_VERTICAL_METRICS = 1<<1, }; struct BitmapSize { u32int indexSubtableListOffset; u32int indexSubtableListSize; u32int numberOfIndexSubtables; // u32int colorRef; SbitLineMetrics hori; SbitLineMetrics vert; u16int startGlyphIndex; u16int endGlyphIndex; u8int ppemX; u8int ppemY; u8int bitDepth; s8int flags; IndexSubtableRecord *indexSubtableList; }; int read_BitmapSize(Otf *o, BitmapSize *v); void print_BitmapSize(Otfile *f, int indent, Otf *o, BitmapSize *v); struct TableEBDT { u16int majorVersion; // u16int minorVersion; }; int read_TableEBDT(Otf *o, TableEBDT *v); void print_TableEBDT(Otfile *f, int indent, Otf *o, TableEBDT *v); struct TableEBLC { // u16int majorVersion; // u16int minorVersion; u32int numSizes; BitmapSize *bitmapSizes; }; int read_TableEBLC(Otf *o, TableEBLC *v); void print_TableEBLC(Otfile *f, int indent, Otf *o, TableEBLC *v); struct AttachList { u16int coverageOffset; u16int glyphCount; u16int *attachPointOffsets; }; int read_AttachList(Otf *o, AttachList *v); void print_AttachList(Otfile *f, int indent, Otf *o, AttachList *v); struct AttachPoint { u16int pointCount; u16int *pointIndices; }; int read_AttachPoint(Otf *o, AttachPoint *v); void print_AttachPoint(Otfile *f, int indent, Otf *o, AttachPoint *v); struct LigCaretList { u16int coverageOffset; u16int ligGlyphCount; u16int *ligGlyphOffsets; }; int read_LigCaretList(Otf *o, LigCaretList *v); void print_LigCaretList(Otfile *f, int indent, Otf *o, LigCaretList *v); struct LigGlyph { u16int caretCount; u16int *caretValueOffsets; }; int read_LigGlyph(Otf *o, LigGlyph *v); void print_LigGlyph(Otfile *f, int indent, Otf *o, LigGlyph *v); struct CaretValue { u16int format; s16int coordinate; u16int caretValuePointIndex; u16int deviceOffset; }; int read_CaretValue(Otf *o, CaretValue *v); void print_CaretValue(Otfile *f, int indent, Otf *o, CaretValue *v); struct ValueRecord { s16int xPlacement; s16int yPlacement; s16int xAdvance; s16int yAdvance; u16int xPlaDeviceOffset; u16int yPlaDeviceOffset; u16int xAdvDeviceOffset; u16int yAdvDeviceOffset; }; int read_ValueRecord(Otf *o, ValueRecord *v); void print_ValueRecord(Otfile *f, int indent, Otf *o, ValueRecord *v); struct SinglePos { u16int format; u16int coverageOffset; u16int valueFormat; ValueRecord valueRecord; u16int valueCount; ValueRecord *valueRecords; }; int read_SinglePos(Otf *o, SinglePos *v); void print_SinglePos(Otfile *f, int indent, Otf *o, SinglePos *v); struct TableGDEF { // u16int majorVersion; u16int minorVersion; u16int glyphClassDefOffset; u16int attachListOffset; u16int ligCaretListOffset; u16int markAttachClassDefOffset; u16int markGlyphSetsDefOffset; u32int itemVarStoreOffset; }; int read_TableGDEF(Otf *o, TableGDEF *v); void print_TableGDEF(Otfile *f, int indent, Otf *o, TableGDEF *v); struct LangSys { // u16int lookupOrderOffset; u16int requiredFeatureIndex; u16int featureIndexCount; u16int *featureIndices; }; int read_LangSys(Otf *o, LangSys *v); void print_LangSys(Otfile *f, int indent, Otf *o, LangSys *v); struct LangSysRecord { u32int langSysTag; u16int langSysOffset; LangSys *langSys; }; int read_LangSysRecord(Otf *o, LangSysRecord *v); void print_LangSysRecord(Otfile *f, int indent, Otf *o, LangSysRecord *v); struct Script { u16int defaultLangSysOffset; u16int langSysCount; LangSysRecord *langSysRecords; LangSys *defaultLangSys; }; int read_Script(Otf *o, Script *v); void print_Script(Otfile *f, int indent, Otf *o, Script *v); struct ScriptRecord { u32int scriptTag; u16int scriptOffset; Script *script; }; int read_ScriptRecord(Otf *o, ScriptRecord *v); void print_ScriptRecord(Otfile *f, int indent, Otf *o, ScriptRecord *v); struct ScriptList { u16int scriptCount; ScriptRecord *scriptRecords; }; int read_ScriptList(Otf *o, ScriptList *v); void print_ScriptList(Otfile *f, int indent, Otf *o, ScriptList *v); struct Feature { u16int featureParamsOffset; u16int lookupIndexCount; u16int *lookupListIndices; }; int read_Feature(Otf *o, Feature *v); void print_Feature(Otfile *f, int indent, Otf *o, Feature *v); struct FeatureRecord { u32int featureTag; u16int featureOffset; Feature *feature; }; int read_FeatureRecord(Otf *o, FeatureRecord *v); void print_FeatureRecord(Otfile *f, int indent, Otf *o, FeatureRecord *v); struct FeatureList { u16int featureCount; FeatureRecord *featureRecords; }; int read_FeatureList(Otf *o, FeatureList *v); void print_FeatureList(Otfile *f, int indent, Otf *o, FeatureList *v); struct SequenceLookup { u16int sequenceIndex; u16int lookupListIndex; }; int read_SequenceLookup(Otf *o, SequenceLookup *v); void print_SequenceLookup(Otfile *f, int indent, Otf *o, SequenceLookup *v); struct ChainedSequenceRule { u16int backtrackGlyphCount; u16int *backtrackSequence; u16int inputGlyphCount; u16int *inputSequence; u16int lookaheadGlyphCount; u16int *lookaheadSequence; u16int seqLookupCount; SequenceLookup *seqLookupRecords; }; int read_ChainedSequenceRule(Otf *o, ChainedSequenceRule *v); void print_ChainedSequenceRule(Otfile *f, int indent, Otf *o, ChainedSequenceRule *v); struct ChainedSequenceRuleSet { u16int chainedSeqRuleCount; u16int *chainedSeqRuleOffsets; ChainedSequenceRule *chainedSeqRule; }; int read_ChainedSequenceRuleSet(Otf *o, ChainedSequenceRuleSet *v); void print_ChainedSequenceRuleSet(Otfile *f, int indent, Otf *o, ChainedSequenceRuleSet *v); struct ChainedSequenceContextFormat1 { u16int coverageOffset; u16int chainedSeqRuleSetCount; u16int *chainedSeqRuleSetOffsets; ChainedSequenceRuleSet *chainedSeqRuleSet; }; int read_ChainedSequenceContextFormat1(Otf *o, ChainedSequenceContextFormat1 *v); void print_ChainedSequenceContextFormat1(Otfile *f, int indent, Otf *o, ChainedSequenceContextFormat1 *v); struct ChainedClassSequenceRuleSet { u16int chainedClassSeqRuleCount; u16int *chainedClassSeqRuleOffsets; ChainedSequenceRule *chainedClassSeqRules; }; int read_ChainedClassSequenceRuleSet(Otf *o, ChainedClassSequenceRuleSet *v); void print_ChainedClassSequenceRuleSet(Otfile *f, int indent, Otf *o, ChainedClassSequenceRuleSet *v); struct ChainedSequenceContextFormat2 { u16int coverageOffset; u16int backtrackClassDefOffset; u16int inputClassDefOffset; u16int lookaheadClassDefOffset; u16int chainedClassSeqRuleSetCount; u16int *chainedClassSeqRuleSetOffsets; ChainedClassSequenceRuleSet *chainedClassSequenceRuleSets; }; int read_ChainedSequenceContextFormat2(Otf *o, ChainedSequenceContextFormat2 *v); void print_ChainedSequenceContextFormat2(Otfile *f, int indent, Otf *o, ChainedSequenceContextFormat2 *v); struct ChainedSequenceContextFormat3 { u16int backtrackGlyphCount; u16int *backtrackCoverageOffsets; u16int inputGlyphCount; u16int *inputCoverageOffsets; u16int lookaheadGlyphCount; u16int *lookaheadCoverageOffsets; u16int seqLookupCount; SequenceLookup *seqLookupRecords; }; int read_ChainedSequenceContextFormat3(Otf *o, ChainedSequenceContextFormat3 *v); void print_ChainedSequenceContextFormat3(Otfile *f, int indent, Otf *o, ChainedSequenceContextFormat3 *v); struct ChainedSequenceContext { u16int format; ChainedSequenceContextFormat1 f1; ChainedSequenceContextFormat2 f2; ChainedSequenceContextFormat3 f3; }; int read_ChainedSequenceContext(Otf *o, ChainedSequenceContext *v); void print_ChainedSequenceContext(Otfile *f, int indent, Otf *o, ChainedSequenceContext *v); struct PairValue { u16int secondGlyph; ValueRecord valueRecord1; ValueRecord valueRecord2; }; int read_PairValue(Otf *o, PairValue *v); void print_PairValue(Otfile *f, int indent, Otf *o, PairValue *v); struct PairSet { u16int pairValueCount; PairValue *pairValueRecords; }; int read_PairSet(Otf *o, PairSet *v); void print_PairSet(Otfile *f, int indent, Otf *o, PairSet *v); struct PairPosFormat1 { u16int pairSetCount; u16int *pairSetOffsets; PairSet *pairSets; }; int read_PairPosFormat1(Otf *o, PairPosFormat1 *v); void print_PairPosFormat1(Otfile *f, int indent, Otf *o, PairPosFormat1 *v); struct Class2 { ValueRecord valueRecord1; ValueRecord valueRecord2; }; int read_Class2(Otf *o, Class2 *v); void print_Class2(Otfile *f, int indent, Otf *o, Class2 *v); struct Class1 { Class2 *class2Records; }; int read_Class1(Otf *o, Class1 *v); void print_Class1(Otfile *f, int indent, Otf *o, Class1 *v); struct PairPosFormat2 { u16int classDef1Offset; u16int classDef2Offset; u16int class1Count; u16int class2Count; Class1 *class1Records; }; int read_PairPosFormat2(Otf *o, PairPosFormat2 *v); void print_PairPosFormat2(Otfile *f, int indent, Otf *o, PairPosFormat2 *v); struct PairPos { u16int format; u16int coverageOffset; u16int valueFormat1; u16int valueFormat2; PairPosFormat1 f1; PairPosFormat2 f2; }; int read_PairPos(Otf *o, PairPos *v); void print_PairPos(Otfile *f, int indent, Otf *o, PairPos *v); struct EntryExit { u16int entryAnchorOffset; u16int exitAnchorOffset; }; int read_EntryExit(Otf *o, EntryExit *v); void print_EntryExit(Otfile *f, int indent, Otf *o, EntryExit *v); struct CursivePos { // u16int format; u16int coverageOffset; u16int entryExitCount; EntryExit *entryExitRecords; }; int read_CursivePos(Otf *o, CursivePos *v); void print_CursivePos(Otfile *f, int indent, Otf *o, CursivePos *v); enum { // Lookup // lookupFlag LOOKUP_FL_RIGHT_TO_LEFT = 1<<0, LOOKUP_FL_IGNORE_BASE_GLYPHS = 1<<1, LOOKUP_FL_IGNORE_LIGATURES = 1<<2, LOOKUP_FL_IGNORE_MARKS = 1<<3, LOOKUP_FL_USE_MARK_FILTERING_SET = 1<<4, // lookupType LOOKUP_TYPE_SINGLE_ADJUSTMENT = 1, LOOKUP_TYPE_PAIR_ADJUSTMENT = 2, LOOKUP_TYPE_CURSIVE_ATTACHMENT = 3, LOOKUP_TYPE_MARK_TO_BASE_ATTACHMENT = 4, LOOKUP_TYPE_MARK_TO_LIGATURE_ATTACHMENT = 5, LOOKUP_TYPE_MARK_TO_MARK_ATTACHMENT = 6, LOOKUP_TYPE_CONTEXTUAL_POSITIONING = 7, LOOKUP_TYPE_CHAINED_CONTEXTS_POSITIONING = 8, LOOKUP_TYPE_POSITIONING_EXTENSION = 9, }; struct Lookup { u16int lookupType; u16int lookupFlag; u16int subTableCount; u16int *subtableOffsets; u16int markFilteringSet; SinglePos *singleAdjustment; PairPos *pairAdjustment; CursivePos *cursiveAttachment; ChainedSequenceContext *chainedContextsPositioning; }; int read_Lookup(Otf *o, Lookup *v); void print_Lookup(Otfile *f, int indent, Otf *o, Lookup *v); struct LookupList { u16int lookupCount; u16int *lookupOffsets; Lookup *lookups; }; int read_LookupList(Otf *o, LookupList *v); void print_LookupList(Otfile *f, int indent, Otf *o, LookupList *v); struct TableGPOS { // u16int majorVersion; u16int minorVersion; u16int scriptListOffset; u16int featureListOffset; u16int lookupListOffset; u32int featureVariationsOffset; ScriptList *scriptList; FeatureList *featureList; LookupList *lookupList; }; int read_TableGPOS(Otf *o, TableGPOS *v); void print_TableGPOS(Otfile *f, int indent, Otf *o, TableGPOS *v); struct TableGSUB { // u16int majorVersion; u16int minorVersion; u16int scriptListOffset; u16int featureListOffset; u16int lookupListOffset; u32int featureVariationsOffset; ScriptList *scriptList; FeatureList *featureList; }; int read_TableGSUB(Otf *o, TableGSUB *v); void print_TableGSUB(Otfile *f, int indent, Otf *o, TableGSUB *v); struct MathValueRecord { s16int value; u16int deviceOffset; }; int read_MathValueRecord(Otf *o, MathValueRecord *v); void print_MathValueRecord(Otfile *f, int indent, Otf *o, MathValueRecord *v); struct MathConstants { s16int scriptPercentScaleDown; s16int scriptScriptPercentScaleDown; u16int delimitedSubFormulaMinHeight; u16int displayOperatorMinHeight; MathValueRecord mathLeading; MathValueRecord axisHeight; MathValueRecord accentBaseHeight; MathValueRecord flattenedAccentBaseHeight; MathValueRecord subscriptShiftDown; MathValueRecord subscriptTopMax; MathValueRecord subscriptBaselineDropMin; MathValueRecord superscriptShiftUp; MathValueRecord superscriptShiftUpCramped; MathValueRecord superscriptBottomMin; MathValueRecord superscriptBaselineDropMax; MathValueRecord subSuperscriptGapMin; MathValueRecord superscriptBottomMaxWithSubscript; MathValueRecord spaceAfterScript; MathValueRecord upperLimitGapMin; MathValueRecord upperLimitBaselineRiseMin; MathValueRecord lowerLimitGapMin; MathValueRecord lowerLimitBaselineDropMin; MathValueRecord stackTopShiftUp; MathValueRecord stackTopDisplayStyleShiftUp; MathValueRecord stackBottomShiftDown; MathValueRecord stackBottomDisplayStyleShiftDown; MathValueRecord stackGapMin; MathValueRecord stackDisplayStyleGapMin; MathValueRecord stretchStackTopShiftUp; MathValueRecord stretchStackBottomShiftDown; MathValueRecord stretchStackGapAboveMin; MathValueRecord stretchStackGapBelowMin; MathValueRecord fractionNumeratorShiftUp; MathValueRecord fractionNumeratorDisplayStyleShiftUp; MathValueRecord fractionDenominatorShiftDown; MathValueRecord fractionDenominatorDisplayStyleShiftDown; MathValueRecord fractionNumeratorGapMin; MathValueRecord fractionNumDisplayStyleGapMin; MathValueRecord fractionRuleThickness; MathValueRecord fractionDenominatorGapMin; MathValueRecord fractionDenomDisplayStyleGapMin; MathValueRecord skewedFractionHorizontalGap; MathValueRecord skewedFractionVerticalGap; MathValueRecord overbarVerticalGap; MathValueRecord overbarRuleThickness; MathValueRecord overbarExtraAscender; MathValueRecord underbarVerticalGap; MathValueRecord underbarRuleThickness; MathValueRecord underbarExtraDescender; MathValueRecord radicalVerticalGap; MathValueRecord radicalDisplayStyleVerticalGap; MathValueRecord radicalRuleThickness; MathValueRecord radicalExtraAscender; MathValueRecord radicalKernBeforeDegree; MathValueRecord radicalKernAfterDegree; s16int radicalDegreeBottomRaisePercent; }; int read_MathConstants(Otf *o, MathConstants *v); void print_MathConstants(Otfile *f, int indent, Otf *o, MathConstants *v); struct MathItalicsCorrectionInfo { u16int italicsCorrectionCoverageOffset; u16int italicsCorrectionCount; MathValueRecord *italicsCorrection; }; int read_MathItalicsCorrectionInfo(Otf *o, MathItalicsCorrectionInfo *v); void print_MathItalicsCorrectionInfo(Otfile *f, int indent, Otf *o, MathItalicsCorrectionInfo *v); struct MathTopAccentAttachment { u16int topAccentCoverageOffset; u16int topAccentAttachmentCount; MathValueRecord *topAccentAttachment; }; int read_MathTopAccentAttachment(Otf *o, MathTopAccentAttachment *v); void print_MathTopAccentAttachment(Otfile *f, int indent, Otf *o, MathTopAccentAttachment *v); struct MathKernInfoRecord { u16int topRightMathKernOffset; u16int topLeftMathKernOffset; u16int bottomRightMathKernOffset; u16int bottomLeftMathKernOffset; }; int read_MathKernInfoRecord(Otf *o, MathKernInfoRecord *v); void print_MathKernInfoRecord(Otfile *f, int indent, Otf *o, MathKernInfoRecord *v); struct MathKernInfo { u16int mathKernCoverageOffset; u16int mathKernCount; MathKernInfoRecord *mathKernInfoRecords; }; int read_MathKernInfo(Otf *o, MathKernInfo *v); void print_MathKernInfo(Otfile *f, int indent, Otf *o, MathKernInfo *v); struct MathKern { u16int heightCount; MathValueRecord *correctionHeight; MathValueRecord *kernValues; }; int read_MathKern(Otf *o, MathKern *v); void print_MathKern(Otfile *f, int indent, Otf *o, MathKern *v); struct Coverage1 { u16int glyphCount; u16int *glyphArray; }; int read_Coverage1(Otf *o, Coverage1 *v); void print_Coverage1(Otfile *f, int indent, Otf *o, Coverage1 *v); struct RangeRecord { u16int startGlyphID; u16int endGlyphID; u16int startCoverageIndex; }; int read_RangeRecord(Otf *o, RangeRecord *v); void print_RangeRecord(Otfile *f, int indent, Otf *o, RangeRecord *v); struct Coverage2 { u16int rangeCount; RangeRecord *rangeRecords; }; int read_Coverage2(Otf *o, Coverage2 *v); void print_Coverage2(Otfile *f, int indent, Otf *o, Coverage2 *v); struct Coverage { u16int format; Coverage1 cov1; Coverage2 cov2; }; int read_Coverage(Otf *o, Coverage *v); void print_Coverage(Otfile *f, int indent, Otf *o, Coverage *v); struct MathGlyphVariantRecord { u16int variantGlyph; u16int advanceMeasurement; }; int read_MathGlyphVariantRecord(Otf *o, MathGlyphVariantRecord *v); void print_MathGlyphVariantRecord(Otfile *f, int indent, Otf *o, MathGlyphVariantRecord *v); struct GlyphPart { u16int glyphID; u16int startConnectorLength; u16int endConnectorLength; u16int fullAdvance; u16int partFlags; }; int read_GlyphPart(Otf *o, GlyphPart *v); void print_GlyphPart(Otfile *f, int indent, Otf *o, GlyphPart *v); struct GlyphAssembly { MathValueRecord italicsCorrection; u16int partCount; GlyphPart *partRecords; }; int read_GlyphAssembly(Otf *o, GlyphAssembly *v); void print_GlyphAssembly(Otfile *f, int indent, Otf *o, GlyphAssembly *v); struct MathGlyphConstruction { u16int glyphAssemblyOffset; u16int variantCount; MathGlyphVariantRecord *mathGlyphVariantRecords; GlyphAssembly *glyphAssembly; }; int read_MathGlyphConstruction(Otf *o, MathGlyphConstruction *v); void print_MathGlyphConstruction(Otfile *f, int indent, Otf *o, MathGlyphConstruction *v); struct MathVariants { u16int minConnectorOverlap; u16int vertGlyphCoverageOffset; u16int horizGlyphCoverageOffset; u16int vertGlyphCount; u16int horizGlyphCount; u16int *vertGlyphConstructionOffsets; u16int *horizGlyphConstructionOffsets; Coverage *vertGlyphCoverage; Coverage *horizGlyphCoverage; MathGlyphConstruction *vertGlyphConstruction; MathGlyphConstruction *horizGlyphConstruction; }; int read_MathVariants(Otf *o, MathVariants *v); void print_MathVariants(Otfile *f, int indent, Otf *o, MathVariants *v); struct MathGlyphInfo { u16int mathItalicsCorrectionInfoOffset; u16int mathTopAccentAttachmentOffset; u16int extendedShapeCoverageOffset; u16int mathKernInfoOffset; MathItalicsCorrectionInfo *mathItalicsCorrectionInfo; MathTopAccentAttachment *mathTopAccentAttachment; MathKernInfo *mathKernInfo; Coverage *extendedShapeCoverage; }; int read_MathGlyphInfo(Otf *o, MathGlyphInfo *v); void print_MathGlyphInfo(Otfile *f, int indent, Otf *o, MathGlyphInfo *v); struct TableMATH { // u16int majorVersion; // u16int minorVersion; u16int mathConstantsOffset; u16int mathGlyphInfoOffset; u16int mathVariantsOffset; MathConstants *mathConstants; MathGlyphInfo *mathGlyphInfo; MathVariants *mathVariants; }; int read_TableMATH(Otf *o, TableMATH *v); void print_TableMATH(Otfile *f, int indent, Otf *o, TableMATH *v); struct KernPair { u16int left; u16int right; s16int value; }; int read_KernPair(Otf *o, KernPair *v); void print_KernPair(Otfile *f, int indent, Otf *o, KernPair *v); struct KernSubtable0 { u16int nPairs; u16int searchRange; u16int entrySelector; u16int rangeShift; KernPair *kernPairs; }; int read_KernSubtable0(Otf *o, KernSubtable0 *v); void print_KernSubtable0(Otfile *f, int indent, Otf *o, KernSubtable0 *v); struct KernClass { u16int firstGlyph; u16int nGlyphs; u16int *values; }; int read_KernClass(Otf *o, KernClass *v); void print_KernClass(Otfile *f, int indent, Otf *o, KernClass *v); struct KernSubtable2 { u16int rowWidth; u16int leftClassOffset; u16int rightClassOffset; u16int kerningArrayOffset; KernClass *leftClass; KernClass *rightClass; s16int *kerningArray; }; int read_KernSubtable2(Otf *o, KernSubtable2 *v); void print_KernSubtable2(Otfile *f, int indent, Otf *o, KernSubtable2 *v); enum { // KernSubtable // coverage KERN_FL_HORIZONTAL = 1<<0, KERN_FL_MINIMUM = 1<<1, KERN_FL_CROSS_STREAM = 1<<2, KERN_FL_OVERRIDE = 1<<3, }; struct KernSubtable { // u16int version; u16int length; u16int coverage; KernSubtable0 sub0; KernSubtable2 sub2; }; int read_KernSubtable(Otf *o, KernSubtable *v); void print_KernSubtable(Otfile *f, int indent, Otf *o, KernSubtable *v); struct TableKern { // u16int version; u16int nTables; KernSubtable *subtables; }; int read_TableKern(Otf *o, TableKern *v); void print_TableKern(Otfile *f, int indent, Otf *o, TableKern *v); struct TableLoca { u16int *shortOffsets; u32int *longOffsets; }; int read_TableLoca(Otf *o, TableLoca *v); void print_TableLoca(Otfile *f, int indent, Otf *o, TableLoca *v); struct GlyphData { s16int originOffsetX; s16int originOffsetY; u32int graphicType; }; int read_GlyphData(Otf *o, GlyphData *v); void print_GlyphData(Otfile *f, int indent, Otf *o, GlyphData *v); struct SbixStrike { u16int ppem; u16int ppi; u32int *glyphDataOffsets; GlyphData *glyphData; }; int read_SbixStrike(Otf *o, SbixStrike *v); void print_SbixStrike(Otfile *f, int indent, Otf *o, SbixStrike *v); enum { // TableSbix // flags SBIX_FL_DRAW_OUTLINES = 1<<1, }; struct TableSbix { // u16int version; u16int flags; u32int numStrikes; u32int *strikeOffsets; SbixStrike *strikes; }; int read_TableSbix(Otf *o, TableSbix *v); void print_TableSbix(Otfile *f, int indent, Otf *o, TableSbix *v); enum { // VariationAxisRecord // flags VARIATIONAXISRECORD_FL_HIDDEN_AXIS = 1<<0, }; struct VariationAxisRecord { u32int axisTag; double minValue; double defaultValue; double maxValue; u16int flags; u16int axisNameID; }; int read_VariationAxisRecord(Otf *o, VariationAxisRecord *v); void print_VariationAxisRecord(Otfile *f, int indent, Otf *o, VariationAxisRecord *v); struct UserTuple { double *coordinates; }; int read_UserTuple(Otf *o, UserTuple *v); void print_UserTuple(Otfile *f, int indent, Otf *o, UserTuple *v); struct InstanceRecord { u16int subfamilyNameID; // u16int flags; UserTuple coordinates; u16int postScriptNameID; }; int read_InstanceRecord(Otf *o, InstanceRecord *v); void print_InstanceRecord(Otfile *f, int indent, Otf *o, InstanceRecord *v); struct AxisInstances { VariationAxisRecord *axes; InstanceRecord *instaces; }; int read_AxisInstances(Otf *o, AxisInstances *v); void print_AxisInstances(Otfile *f, int indent, Otf *o, AxisInstances *v); struct TableFvar { // u16int majorVersion; // u16int minorVersion; u16int axesArrayOffset; // u16int reserved; u16int axisCount; // u16int axisSize; u16int instanceCount; u16int instanceSize; AxisInstances *axisInstances; }; int read_TableFvar(Otf *o, TableFvar *v); void print_TableFvar(Otfile *f, int indent, Otf *o, TableFvar *v); struct RegionAxisCoordinates { double startCoord; double peakCoord; double endCoord; }; int read_RegionAxisCoordinates(Otf *o, RegionAxisCoordinates *v); void print_RegionAxisCoordinates(Otfile *f, int indent, Otf *o, RegionAxisCoordinates *v); struct VariationRegion { RegionAxisCoordinates *regionAxes; }; int read_VariationRegion(Otf *o, VariationRegion *v); void print_VariationRegion(Otfile *f, int indent, Otf *o, VariationRegion *v); struct VariationRegionList { u16int axisCount; u16int regionCount; VariationRegion *variationRegion; }; int read_VariationRegionList(Otf *o, VariationRegionList *v); void print_VariationRegionList(Otfile *f, int indent, Otf *o, VariationRegionList *v); struct ItemVariationData { u16int itemCount; u16int wordDeltaCount; u16int regionIndexCount; u16int *regionIndexes; }; int read_ItemVariationData(Otf *o, ItemVariationData *v); void print_ItemVariationData(Otfile *f, int indent, Otf *o, ItemVariationData *v); struct ItemVariationStore { // u16int format; u32int variationRegionListOffset; u16int itemVariationDataCount; u32int *itemVariationDataOffsets; ItemVariationData *itemVariationData; }; int read_ItemVariationStore(Otf *o, ItemVariationStore *v); void print_ItemVariationStore(Otfile *f, int indent, Otf *o, ItemVariationStore *v); struct DeltaSetIndexMap { u8int format; u8int entryFormat; u16int mapCount0; u32int mapCount1; u8int mapData; }; int read_DeltaSetIndexMap(Otf *o, DeltaSetIndexMap *v); void print_DeltaSetIndexMap(Otfile *f, int indent, Otf *o, DeltaSetIndexMap *v); struct TableHVAR { // u16int majorVersion; // u16int minorVersion; u32int itemVariationStoreOffset; u32int advanceWidthMappingOffset; u32int lsbMappingOffset; u32int rsbMappingOffset; ItemVariationStore *itemVariationStore; DeltaSetIndexMap *advanceWidthMapping; DeltaSetIndexMap *lsbMapping; DeltaSetIndexMap *rsbMapping; }; int read_TableHVAR(Otf *o, TableHVAR *v); void print_TableHVAR(Otfile *f, int indent, Otf *o, TableHVAR *v); struct TableFFTM { u32int version; s64int fontforge; s64int created; s64int modified; }; int read_TableFFTM(Otf *o, TableFFTM *v); void print_TableFFTM(Otfile *f, int indent, Otf *o, TableFFTM *v); struct SignatureBlock1 { // u16int reserved1; // u16int reserved2; u32int signatureLength; u8int *signature; }; int read_SignatureBlock1(Otf *o, SignatureBlock1 *v); void print_SignatureBlock1(Otfile *f, int indent, Otf *o, SignatureBlock1 *v); struct SignatureRecord { u32int format; u32int length; u32int signatureBlockOffset; SignatureBlock1 *signatureBlock1; }; int read_SignatureRecord(Otf *o, SignatureRecord *v); void print_SignatureRecord(Otfile *f, int indent, Otf *o, SignatureRecord *v); enum { // TableDSIG // flags DSIG_CANNOT_BE_RESIGNED = 1<<0, }; struct TableDSIG { // u32int version; u16int numSignatures; u16int flags; SignatureRecord *signatureRecords; }; int read_TableDSIG(Otf *o, TableDSIG *v); void print_TableDSIG(Otfile *f, int indent, Otf *o, TableDSIG *v); struct AxisRecord { u32int axisTag; u16int axisNameID; u16int axisOrdering; // u8int *unused; }; int read_AxisRecord(Otf *o, AxisRecord *v); void print_AxisRecord(Otfile *f, int indent, Otf *o, AxisRecord *v); struct AxisValueTable1 { u16int axisIndex; u16int flags; u16int valueNameID; double value; }; int read_AxisValueTable1(Otf *o, AxisValueTable1 *v); void print_AxisValueTable1(Otfile *f, int indent, Otf *o, AxisValueTable1 *v); struct AxisValueTable2 { u16int axisIndex; u16int flags; u16int valueNameID; double nominalValue; double rangeMinValue; double rangeMaxValue; }; int read_AxisValueTable2(Otf *o, AxisValueTable2 *v); void print_AxisValueTable2(Otfile *f, int indent, Otf *o, AxisValueTable2 *v); struct AxisValueTable3 { u16int axisIndex; u16int flags; u16int valueNameID; double value; double linkedValue; }; int read_AxisValueTable3(Otf *o, AxisValueTable3 *v); void print_AxisValueTable3(Otfile *f, int indent, Otf *o, AxisValueTable3 *v); struct AxisValue { u16int axisIndex; double value; }; int read_AxisValue(Otf *o, AxisValue *v); void print_AxisValue(Otfile *f, int indent, Otf *o, AxisValue *v); struct AxisValueTable4 { u16int axisCount; u16int flags; u16int valueNameID; AxisValue *axisValues; }; int read_AxisValueTable4(Otf *o, AxisValueTable4 *v); void print_AxisValueTable4(Otfile *f, int indent, Otf *o, AxisValueTable4 *v); struct AxisValueTable { u16int format; AxisValueTable1 f1; AxisValueTable2 f2; AxisValueTable3 f3; AxisValueTable3 f4; }; int read_AxisValueTable(Otf *o, AxisValueTable *v); void print_AxisValueTable(Otfile *f, int indent, Otf *o, AxisValueTable *v); struct DesignAxes { AxisRecord *designAxes; u16int *axisValueTableOffsets; AxisValueTable *axisValueTables; }; int read_DesignAxes(Otf *o, DesignAxes *v); void print_DesignAxes(Otfile *f, int indent, Otf *o, DesignAxes *v); struct TableSTAT { // u16int majorVersion; u16int minorVersion; u16int designAxisSize; u16int designAxisCount; u32int designAxesOffset; u16int axisValueCount; u32int offsetToAxisValueOffsets; u16int elidedFallbackNameID; DesignAxes *designAxes; }; int read_TableSTAT(Otf *o, TableSTAT *v); void print_TableSTAT(Otfile *f, int indent, Otf *o, TableSTAT *v); enum { // GaspRange // rangeGaspBehavior GASP_GRIDFIT = 1<<0, GASP_DOGRAY = 1<<1, GASP_SYMMETRIC_GRIDFIT = 1<<2, GASP_SYMMETRIC_SMOOTHING = 1<<3, }; struct GaspRange { u16int rangeMaxPPEM; u16int rangeGaspBehavior; }; int read_GaspRange(Otf *o, GaspRange *v); void print_GaspRange(Otfile *f, int indent, Otf *o, GaspRange *v); struct TableGasp { u16int version; u16int numRanges; GaspRange *gaspRanges; }; int read_TableGasp(Otf *o, TableGasp *v); void print_TableGasp(Otfile *f, int indent, Otf *o, TableGasp *v); struct Tuple { double *coordinates; }; int read_Tuple(Otf *o, Tuple *v); void print_Tuple(Otfile *f, int indent, Otf *o, Tuple *v); enum { // TupleVariationHeader // tupleIndex TUPLEINDEX_FL_PRIVATE_POINT_NUMBERS = 1<<13, TUPLEINDEX_FL_INTERMEDIATE_REGION = 1<<14, TUPLEINDEX_FL_EMBEDDED_PEAK_TUPLE = 1<<15, }; struct TupleVariationHeader { u16int variationDataSize; u16int tupleIndex; Tuple peakTuple; Tuple intermediateStartTuple; Tuple intermediateEndTuple; }; int read_TupleVariationHeader(Otf *o, TupleVariationHeader *v); void print_TupleVariationHeader(Otfile *f, int indent, Otf *o, TupleVariationHeader *v); enum { // GlyphVariationData // tupleVariationCount COUNT_FL_SHARED_POINT_NUMBERS = 1<<15, }; struct GlyphVariationData { u16int tupleVariationCount; u16int dataOffset; TupleVariationHeader *tupleVariationHeaders; }; int read_GlyphVariationData(Otf *o, GlyphVariationData *v); void print_GlyphVariationData(Otfile *f, int indent, Otf *o, GlyphVariationData *v); enum { // TableGvar // flags GVAR_FL_LONG_OFFSETS = 1<<0, }; struct TableGvar { // u16int majorVersion; // u16int minorVersion; u16int axisCount; u16int sharedTupleCount; u32int sharedTuplesOffset; u16int glyphCount; u16int flags; u32int glyphVariationDataArrayOffset; u16int *glyphVariationDataOffsetsShort; u32int *glyphVariationDataOffsetsLong; GlyphVariationData *glyphVariationData; Tuple *sharedTuples; }; int read_TableGvar(Otf *o, TableGvar *v); void print_TableGvar(Otfile *f, int indent, Otf *o, TableGvar *v); struct AxisValueMap { double fromCoordinate; double toCoordinate; }; int read_AxisValueMap(Otf *o, AxisValueMap *v); void print_AxisValueMap(Otfile *f, int indent, Otf *o, AxisValueMap *v); struct SegmentMaps { u16int positionMapCount; AxisValueMap *axisValueMaps; }; int read_SegmentMaps(Otf *o, SegmentMaps *v); void print_SegmentMaps(Otfile *f, int indent, Otf *o, SegmentMaps *v); struct TableAvar { // u16int majorVersion; // u16int minorVersion; // u16int reserved; u16int axisCount; SegmentMaps *axisSegmentMaps; }; int read_TableAvar(Otf *o, TableAvar *v); void print_TableAvar(Otfile *f, int indent, Otf *o, TableAvar *v); struct TableOS∕2 { u16int version; s16int xAvgCharWidth; u16int usWeightClass; u16int usWidthClass; u16int fsType; s16int ySubscriptXSize; s16int ySubscriptYSize; s16int ySubscriptXOffset; s16int ySubscriptYOffset; s16int ySuperscriptXSize; s16int ySuperscriptYSize; s16int ySuperscriptXOffset; s16int ySuperscriptYOffset; s16int yStrikeoutSize; s16int yStrikeoutPosition; s16int sFamilyClass; u8int panose[10]; u32int ulUnicodeRange1; u32int ulUnicodeRange2; u32int ulUnicodeRange3; u32int ulUnicodeRange4; u32int achVendID; u16int fsSelection; u16int usFirstCharIndex; u16int usLastCharIndex; s16int sTypoAscender; s16int sTypoDescender; s16int sTypoLineGap; u16int usWinAscent; u16int usWinDescent; u32int ulCodePageRange1; u32int ulCodePageRange2; s16int sxHeight; s16int sCapHeight; u16int usDefaultChar; u16int usBreakChar; u16int usMaxContext; u16int usLowerOpticalPointSize; u16int usUpperOpticalPointSize; }; int read_TableOS∕2(Otf *o, TableOS∕2 *v); void print_TableOS∕2(Otfile *f, int indent, Otf *o, TableOS∕2 *v); struct TableRecord { u32int tableTag; // u32int checksum; u32int offset; u32int length; void *parsed; void (*print)(Otfile *f, int indent, Otf *o, void *parsed); }; int read_TableRecord(Otf *o, TableRecord *v); void print_TableRecord(Otfile *f, int indent, Otf *o, TableRecord *v); struct TableDirectory { u32int sfntVersion; u16int numTables; u16int searchRange; u16int entrySelector; u16int rangeShift; TableRecord *tableRecords; TableCmap *cmap; TableHead *head; TableHhea *hhea; TableMaxp *maxp; TableHmtx *hmtx; TablePost *post; TableName *name; TableEBDT *ebdt; TableEBLC *eblc; TableGDEF *gdef; TableGPOS *gpos; TableGSUB *gsub; TableMATH *math; TableKern *kern; TableLoca *loca; TableSbix *sbix; TableFvar *fvar; TableHVAR *hvar; TableFFTM *fftm; TableDSIG *dsig; TableSTAT *stat; TableGasp *gasp; TableGvar *gvar; TableAvar *avar; TableOS∕2 *os∕2; }; int read_TableDirectory(Otf *o, TableDirectory *v); void print_TableDirectory(Otfile *f, int indent, Otf *o, TableDirectory *v);