nuclear@0: /***************************************************************************/ nuclear@0: /* */ nuclear@0: /* tttypes.h */ nuclear@0: /* */ nuclear@0: /* Basic SFNT/TrueType type definitions and interface (specification */ nuclear@0: /* only). */ nuclear@0: /* */ nuclear@0: /* Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007, 2008 by */ nuclear@0: /* David Turner, Robert Wilhelm, and Werner Lemberg. */ nuclear@0: /* */ nuclear@0: /* This file is part of the FreeType project, and may only be used, */ nuclear@0: /* modified, and distributed under the terms of the FreeType project */ nuclear@0: /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ nuclear@0: /* this file you indicate that you have read the license and */ nuclear@0: /* understand and accept it fully. */ nuclear@0: /* */ nuclear@0: /***************************************************************************/ nuclear@0: nuclear@0: nuclear@0: #ifndef __TTTYPES_H__ nuclear@0: #define __TTTYPES_H__ nuclear@0: nuclear@0: nuclear@0: #include nuclear@0: #include FT_TRUETYPE_TABLES_H nuclear@0: #include FT_INTERNAL_OBJECTS_H nuclear@0: nuclear@0: #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT nuclear@0: #include FT_MULTIPLE_MASTERS_H nuclear@0: #endif nuclear@0: nuclear@0: nuclear@0: FT_BEGIN_HEADER nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: /*** ***/ nuclear@0: /*** ***/ nuclear@0: /*** REQUIRED TRUETYPE/OPENTYPE TABLES DEFINITIONS ***/ nuclear@0: /*** ***/ nuclear@0: /*** ***/ nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TTC_HeaderRec */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TrueType collection header. This table contains the offsets of */ nuclear@0: /* the font headers of each distinct TrueType face in the file. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* tag :: Must be `ttc ' to indicate a TrueType collection. */ nuclear@0: /* */ nuclear@0: /* version :: The version number. */ nuclear@0: /* */ nuclear@0: /* count :: The number of faces in the collection. The */ nuclear@0: /* specification says this should be an unsigned long, but */ nuclear@0: /* we use a signed long since we need the value -1 for */ nuclear@0: /* specific purposes. */ nuclear@0: /* */ nuclear@0: /* offsets :: The offsets of the font headers, one per face. */ nuclear@0: /* */ nuclear@0: typedef struct TTC_HeaderRec_ nuclear@0: { nuclear@0: FT_ULong tag; nuclear@0: FT_Fixed version; nuclear@0: FT_Long count; nuclear@0: FT_ULong* offsets; nuclear@0: nuclear@0: } TTC_HeaderRec; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* SFNT_HeaderRec */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* SFNT file format header. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* format_tag :: The font format tag. */ nuclear@0: /* */ nuclear@0: /* num_tables :: The number of tables in file. */ nuclear@0: /* */ nuclear@0: /* search_range :: Must be `16 * (max power of 2 <= num_tables)'. */ nuclear@0: /* */ nuclear@0: /* entry_selector :: Must be log2 of `search_range / 16'. */ nuclear@0: /* */ nuclear@0: /* range_shift :: Must be `num_tables * 16 - search_range'. */ nuclear@0: /* */ nuclear@0: typedef struct SFNT_HeaderRec_ nuclear@0: { nuclear@0: FT_ULong format_tag; nuclear@0: FT_UShort num_tables; nuclear@0: FT_UShort search_range; nuclear@0: FT_UShort entry_selector; nuclear@0: FT_UShort range_shift; nuclear@0: nuclear@0: FT_ULong offset; /* not in file */ nuclear@0: nuclear@0: } SFNT_HeaderRec, *SFNT_Header; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TT_TableRec */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* This structure describes a given table of a TrueType font. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* Tag :: A four-bytes tag describing the table. */ nuclear@0: /* */ nuclear@0: /* CheckSum :: The table checksum. This value can be ignored. */ nuclear@0: /* */ nuclear@0: /* Offset :: The offset of the table from the start of the TrueType */ nuclear@0: /* font in its resource. */ nuclear@0: /* */ nuclear@0: /* Length :: The table length (in bytes). */ nuclear@0: /* */ nuclear@0: typedef struct TT_TableRec_ nuclear@0: { nuclear@0: FT_ULong Tag; /* table type */ nuclear@0: FT_ULong CheckSum; /* table checksum */ nuclear@0: FT_ULong Offset; /* table file offset */ nuclear@0: FT_ULong Length; /* table length */ nuclear@0: nuclear@0: } TT_TableRec, *TT_Table; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TT_LongMetricsRec */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* A structure modeling the long metrics of the `hmtx' and `vmtx' */ nuclear@0: /* TrueType tables. The values are expressed in font units. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* advance :: The advance width or height for the glyph. */ nuclear@0: /* */ nuclear@0: /* bearing :: The left-side or top-side bearing for the glyph. */ nuclear@0: /* */ nuclear@0: typedef struct TT_LongMetricsRec_ nuclear@0: { nuclear@0: FT_UShort advance; nuclear@0: FT_Short bearing; nuclear@0: nuclear@0: } TT_LongMetricsRec, *TT_LongMetrics; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TT_ShortMetrics */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* A simple type to model the short metrics of the `hmtx' and `vmtx' */ nuclear@0: /* tables. */ nuclear@0: /* */ nuclear@0: typedef FT_Short TT_ShortMetrics; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TT_NameEntryRec */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* A structure modeling TrueType name records. Name records are used */ nuclear@0: /* to store important strings like family name, style name, */ nuclear@0: /* copyright, etc. in _localized_ versions (i.e., language, encoding, */ nuclear@0: /* etc). */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* platformID :: The ID of the name's encoding platform. */ nuclear@0: /* */ nuclear@0: /* encodingID :: The platform-specific ID for the name's encoding. */ nuclear@0: /* */ nuclear@0: /* languageID :: The platform-specific ID for the name's language. */ nuclear@0: /* */ nuclear@0: /* nameID :: The ID specifying what kind of name this is. */ nuclear@0: /* */ nuclear@0: /* stringLength :: The length of the string in bytes. */ nuclear@0: /* */ nuclear@0: /* stringOffset :: The offset to the string in the `name' table. */ nuclear@0: /* */ nuclear@0: /* string :: A pointer to the string's bytes. Note that these */ nuclear@0: /* are usually UTF-16 encoded characters. */ nuclear@0: /* */ nuclear@0: typedef struct TT_NameEntryRec_ nuclear@0: { nuclear@0: FT_UShort platformID; nuclear@0: FT_UShort encodingID; nuclear@0: FT_UShort languageID; nuclear@0: FT_UShort nameID; nuclear@0: FT_UShort stringLength; nuclear@0: FT_ULong stringOffset; nuclear@0: nuclear@0: /* this last field is not defined in the spec */ nuclear@0: /* but used by the FreeType engine */ nuclear@0: nuclear@0: FT_Byte* string; nuclear@0: nuclear@0: } TT_NameEntryRec, *TT_NameEntry; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TT_NameTableRec */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* A structure modeling the TrueType name table. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* format :: The format of the name table. */ nuclear@0: /* */ nuclear@0: /* numNameRecords :: The number of names in table. */ nuclear@0: /* */ nuclear@0: /* storageOffset :: The offset of the name table in the `name' */ nuclear@0: /* TrueType table. */ nuclear@0: /* */ nuclear@0: /* names :: An array of name records. */ nuclear@0: /* */ nuclear@0: /* stream :: the file's input stream. */ nuclear@0: /* */ nuclear@0: typedef struct TT_NameTableRec_ nuclear@0: { nuclear@0: FT_UShort format; nuclear@0: FT_UInt numNameRecords; nuclear@0: FT_UInt storageOffset; nuclear@0: TT_NameEntryRec* names; nuclear@0: FT_Stream stream; nuclear@0: nuclear@0: } TT_NameTableRec, *TT_NameTable; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: /*** ***/ nuclear@0: /*** ***/ nuclear@0: /*** OPTIONAL TRUETYPE/OPENTYPE TABLES DEFINITIONS ***/ nuclear@0: /*** ***/ nuclear@0: /*** ***/ nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TT_GaspRangeRec */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* A tiny structure used to model a gasp range according to the */ nuclear@0: /* TrueType specification. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* maxPPEM :: The maximum ppem value to which `gaspFlag' applies. */ nuclear@0: /* */ nuclear@0: /* gaspFlag :: A flag describing the grid-fitting and anti-aliasing */ nuclear@0: /* modes to be used. */ nuclear@0: /* */ nuclear@0: typedef struct TT_GaspRangeRec_ nuclear@0: { nuclear@0: FT_UShort maxPPEM; nuclear@0: FT_UShort gaspFlag; nuclear@0: nuclear@0: } TT_GaspRangeRec, *TT_GaspRange; nuclear@0: nuclear@0: nuclear@0: #define TT_GASP_GRIDFIT 0x01 nuclear@0: #define TT_GASP_DOGRAY 0x02 nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TT_GaspRec */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* A structure modeling the TrueType `gasp' table used to specify */ nuclear@0: /* grid-fitting and anti-aliasing behaviour. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* version :: The version number. */ nuclear@0: /* */ nuclear@0: /* numRanges :: The number of gasp ranges in table. */ nuclear@0: /* */ nuclear@0: /* gaspRanges :: An array of gasp ranges. */ nuclear@0: /* */ nuclear@0: typedef struct TT_Gasp_ nuclear@0: { nuclear@0: FT_UShort version; nuclear@0: FT_UShort numRanges; nuclear@0: TT_GaspRange gaspRanges; nuclear@0: nuclear@0: } TT_GaspRec; nuclear@0: nuclear@0: nuclear@0: #ifdef FT_CONFIG_OPTION_OLD_INTERNALS nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TT_HdmxEntryRec */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* A small structure used to model the pre-computed widths of a given */ nuclear@0: /* size. They are found in the `hdmx' table. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* ppem :: The pixels per EM value at which these metrics apply. */ nuclear@0: /* */ nuclear@0: /* max_width :: The maximum advance width for this metric. */ nuclear@0: /* */ nuclear@0: /* widths :: An array of widths. Note: These are 8-bit bytes. */ nuclear@0: /* */ nuclear@0: typedef struct TT_HdmxEntryRec_ nuclear@0: { nuclear@0: FT_Byte ppem; nuclear@0: FT_Byte max_width; nuclear@0: FT_Byte* widths; nuclear@0: nuclear@0: } TT_HdmxEntryRec, *TT_HdmxEntry; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TT_HdmxRec */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* A structure used to model the `hdmx' table, which contains */ nuclear@0: /* pre-computed widths for a set of given sizes/dimensions. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* version :: The version number. */ nuclear@0: /* */ nuclear@0: /* num_records :: The number of hdmx records. */ nuclear@0: /* */ nuclear@0: /* records :: An array of hdmx records. */ nuclear@0: /* */ nuclear@0: typedef struct TT_HdmxRec_ nuclear@0: { nuclear@0: FT_UShort version; nuclear@0: FT_Short num_records; nuclear@0: TT_HdmxEntry records; nuclear@0: nuclear@0: } TT_HdmxRec, *TT_Hdmx; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TT_Kern0_PairRec */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* A structure used to model a kerning pair for the kerning table */ nuclear@0: /* format 0. The engine now loads this table if it finds one in the */ nuclear@0: /* font file. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* left :: The index of the left glyph in pair. */ nuclear@0: /* */ nuclear@0: /* right :: The index of the right glyph in pair. */ nuclear@0: /* */ nuclear@0: /* value :: The kerning distance. A positive value spaces the */ nuclear@0: /* glyphs, a negative one makes them closer. */ nuclear@0: /* */ nuclear@0: typedef struct TT_Kern0_PairRec_ nuclear@0: { nuclear@0: FT_UShort left; /* index of left glyph in pair */ nuclear@0: FT_UShort right; /* index of right glyph in pair */ nuclear@0: FT_FWord value; /* kerning value */ nuclear@0: nuclear@0: } TT_Kern0_PairRec, *TT_Kern0_Pair; nuclear@0: nuclear@0: #endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: /*** ***/ nuclear@0: /*** ***/ nuclear@0: /*** EMBEDDED BITMAPS SUPPORT ***/ nuclear@0: /*** ***/ nuclear@0: /*** ***/ nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TT_SBit_MetricsRec */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* A structure used to hold the big metrics of a given glyph bitmap */ nuclear@0: /* in a TrueType or OpenType font. These are usually found in the */ nuclear@0: /* `EBDT' (Microsoft) or `bloc' (Apple) table. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* height :: The glyph height in pixels. */ nuclear@0: /* */ nuclear@0: /* width :: The glyph width in pixels. */ nuclear@0: /* */ nuclear@0: /* horiBearingX :: The horizontal left bearing. */ nuclear@0: /* */ nuclear@0: /* horiBearingY :: The horizontal top bearing. */ nuclear@0: /* */ nuclear@0: /* horiAdvance :: The horizontal advance. */ nuclear@0: /* */ nuclear@0: /* vertBearingX :: The vertical left bearing. */ nuclear@0: /* */ nuclear@0: /* vertBearingY :: The vertical top bearing. */ nuclear@0: /* */ nuclear@0: /* vertAdvance :: The vertical advance. */ nuclear@0: /* */ nuclear@0: typedef struct TT_SBit_MetricsRec_ nuclear@0: { nuclear@0: FT_Byte height; nuclear@0: FT_Byte width; nuclear@0: nuclear@0: FT_Char horiBearingX; nuclear@0: FT_Char horiBearingY; nuclear@0: FT_Byte horiAdvance; nuclear@0: nuclear@0: FT_Char vertBearingX; nuclear@0: FT_Char vertBearingY; nuclear@0: FT_Byte vertAdvance; nuclear@0: nuclear@0: } TT_SBit_MetricsRec, *TT_SBit_Metrics; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TT_SBit_SmallMetricsRec */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* A structure used to hold the small metrics of a given glyph bitmap */ nuclear@0: /* in a TrueType or OpenType font. These are usually found in the */ nuclear@0: /* `EBDT' (Microsoft) or the `bdat' (Apple) table. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* height :: The glyph height in pixels. */ nuclear@0: /* */ nuclear@0: /* width :: The glyph width in pixels. */ nuclear@0: /* */ nuclear@0: /* bearingX :: The left-side bearing. */ nuclear@0: /* */ nuclear@0: /* bearingY :: The top-side bearing. */ nuclear@0: /* */ nuclear@0: /* advance :: The advance width or height. */ nuclear@0: /* */ nuclear@0: typedef struct TT_SBit_Small_Metrics_ nuclear@0: { nuclear@0: FT_Byte height; nuclear@0: FT_Byte width; nuclear@0: nuclear@0: FT_Char bearingX; nuclear@0: FT_Char bearingY; nuclear@0: FT_Byte advance; nuclear@0: nuclear@0: } TT_SBit_SmallMetricsRec, *TT_SBit_SmallMetrics; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TT_SBit_LineMetricsRec */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* A structure used to describe the text line metrics of a given */ nuclear@0: /* bitmap strike, for either a horizontal or vertical layout. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* ascender :: The ascender in pixels. */ nuclear@0: /* */ nuclear@0: /* descender :: The descender in pixels. */ nuclear@0: /* */ nuclear@0: /* max_width :: The maximum glyph width in pixels. */ nuclear@0: /* */ nuclear@0: /* caret_slope_enumerator :: Rise of the caret slope, typically set */ nuclear@0: /* to 1 for non-italic fonts. */ nuclear@0: /* */ nuclear@0: /* caret_slope_denominator :: Rise of the caret slope, typically set */ nuclear@0: /* to 0 for non-italic fonts. */ nuclear@0: /* */ nuclear@0: /* caret_offset :: Offset in pixels to move the caret for */ nuclear@0: /* proper positioning. */ nuclear@0: /* */ nuclear@0: /* min_origin_SB :: Minimum of horiBearingX (resp. */ nuclear@0: /* vertBearingY). */ nuclear@0: /* min_advance_SB :: Minimum of */ nuclear@0: /* */ nuclear@0: /* horizontal advance - */ nuclear@0: /* ( horiBearingX + width ) */ nuclear@0: /* */ nuclear@0: /* resp. */ nuclear@0: /* */ nuclear@0: /* vertical advance - */ nuclear@0: /* ( vertBearingY + height ) */ nuclear@0: /* */ nuclear@0: /* max_before_BL :: Maximum of horiBearingY (resp. */ nuclear@0: /* vertBearingY). */ nuclear@0: /* */ nuclear@0: /* min_after_BL :: Minimum of */ nuclear@0: /* */ nuclear@0: /* horiBearingY - height */ nuclear@0: /* */ nuclear@0: /* resp. */ nuclear@0: /* */ nuclear@0: /* vertBearingX - width */ nuclear@0: /* */ nuclear@0: /* pads :: Unused (to make the size of the record */ nuclear@0: /* a multiple of 32 bits. */ nuclear@0: /* */ nuclear@0: typedef struct TT_SBit_LineMetricsRec_ nuclear@0: { nuclear@0: FT_Char ascender; nuclear@0: FT_Char descender; nuclear@0: FT_Byte max_width; nuclear@0: FT_Char caret_slope_numerator; nuclear@0: FT_Char caret_slope_denominator; nuclear@0: FT_Char caret_offset; nuclear@0: FT_Char min_origin_SB; nuclear@0: FT_Char min_advance_SB; nuclear@0: FT_Char max_before_BL; nuclear@0: FT_Char min_after_BL; nuclear@0: FT_Char pads[2]; nuclear@0: nuclear@0: } TT_SBit_LineMetricsRec, *TT_SBit_LineMetrics; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TT_SBit_RangeRec */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* A TrueType/OpenType subIndexTable as defined in the `EBLC' */ nuclear@0: /* (Microsoft) or `bloc' (Apple) tables. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* first_glyph :: The first glyph index in the range. */ nuclear@0: /* */ nuclear@0: /* last_glyph :: The last glyph index in the range. */ nuclear@0: /* */ nuclear@0: /* index_format :: The format of index table. Valid values are 1 */ nuclear@0: /* to 5. */ nuclear@0: /* */ nuclear@0: /* image_format :: The format of `EBDT' image data. */ nuclear@0: /* */ nuclear@0: /* image_offset :: The offset to image data in `EBDT'. */ nuclear@0: /* */ nuclear@0: /* image_size :: For index formats 2 and 5. This is the size in */ nuclear@0: /* bytes of each glyph bitmap. */ nuclear@0: /* */ nuclear@0: /* big_metrics :: For index formats 2 and 5. This is the big */ nuclear@0: /* metrics for each glyph bitmap. */ nuclear@0: /* */ nuclear@0: /* num_glyphs :: For index formats 4 and 5. This is the number of */ nuclear@0: /* glyphs in the code array. */ nuclear@0: /* */ nuclear@0: /* glyph_offsets :: For index formats 1 and 3. */ nuclear@0: /* */ nuclear@0: /* glyph_codes :: For index formats 4 and 5. */ nuclear@0: /* */ nuclear@0: /* table_offset :: The offset of the index table in the `EBLC' */ nuclear@0: /* table. Only used during strike loading. */ nuclear@0: /* */ nuclear@0: typedef struct TT_SBit_RangeRec_ nuclear@0: { nuclear@0: FT_UShort first_glyph; nuclear@0: FT_UShort last_glyph; nuclear@0: nuclear@0: FT_UShort index_format; nuclear@0: FT_UShort image_format; nuclear@0: FT_ULong image_offset; nuclear@0: nuclear@0: FT_ULong image_size; nuclear@0: TT_SBit_MetricsRec metrics; nuclear@0: FT_ULong num_glyphs; nuclear@0: nuclear@0: FT_ULong* glyph_offsets; nuclear@0: FT_UShort* glyph_codes; nuclear@0: nuclear@0: FT_ULong table_offset; nuclear@0: nuclear@0: } TT_SBit_RangeRec, *TT_SBit_Range; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TT_SBit_StrikeRec */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* A structure used describe a given bitmap strike in the `EBLC' */ nuclear@0: /* (Microsoft) or `bloc' (Apple) tables. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* num_index_ranges :: The number of index ranges. */ nuclear@0: /* */ nuclear@0: /* index_ranges :: An array of glyph index ranges. */ nuclear@0: /* */ nuclear@0: /* color_ref :: Unused. `color_ref' is put in for future */ nuclear@0: /* enhancements, but these fields are already */ nuclear@0: /* in use by other platforms (e.g. Newton). */ nuclear@0: /* For details, please see */ nuclear@0: /* */ nuclear@0: /* http://fonts.apple.com/ */ nuclear@0: /* TTRefMan/RM06/Chap6bloc.html */ nuclear@0: /* */ nuclear@0: /* hori :: The line metrics for horizontal layouts. */ nuclear@0: /* */ nuclear@0: /* vert :: The line metrics for vertical layouts. */ nuclear@0: /* */ nuclear@0: /* start_glyph :: The lowest glyph index for this strike. */ nuclear@0: /* */ nuclear@0: /* end_glyph :: The highest glyph index for this strike. */ nuclear@0: /* */ nuclear@0: /* x_ppem :: The number of horizontal pixels per EM. */ nuclear@0: /* */ nuclear@0: /* y_ppem :: The number of vertical pixels per EM. */ nuclear@0: /* */ nuclear@0: /* bit_depth :: The bit depth. Valid values are 1, 2, 4, */ nuclear@0: /* and 8. */ nuclear@0: /* */ nuclear@0: /* flags :: Is this a vertical or horizontal strike? For */ nuclear@0: /* details, please see */ nuclear@0: /* */ nuclear@0: /* http://fonts.apple.com/ */ nuclear@0: /* TTRefMan/RM06/Chap6bloc.html */ nuclear@0: /* */ nuclear@0: typedef struct TT_SBit_StrikeRec_ nuclear@0: { nuclear@0: FT_Int num_ranges; nuclear@0: TT_SBit_Range sbit_ranges; nuclear@0: FT_ULong ranges_offset; nuclear@0: nuclear@0: FT_ULong color_ref; nuclear@0: nuclear@0: TT_SBit_LineMetricsRec hori; nuclear@0: TT_SBit_LineMetricsRec vert; nuclear@0: nuclear@0: FT_UShort start_glyph; nuclear@0: FT_UShort end_glyph; nuclear@0: nuclear@0: FT_Byte x_ppem; nuclear@0: FT_Byte y_ppem; nuclear@0: nuclear@0: FT_Byte bit_depth; nuclear@0: FT_Char flags; nuclear@0: nuclear@0: } TT_SBit_StrikeRec, *TT_SBit_Strike; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TT_SBit_ComponentRec */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* A simple structure to describe a compound sbit element. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* glyph_code :: The element's glyph index. */ nuclear@0: /* */ nuclear@0: /* x_offset :: The element's left bearing. */ nuclear@0: /* */ nuclear@0: /* y_offset :: The element's top bearing. */ nuclear@0: /* */ nuclear@0: typedef struct TT_SBit_ComponentRec_ nuclear@0: { nuclear@0: FT_UShort glyph_code; nuclear@0: FT_Char x_offset; nuclear@0: FT_Char y_offset; nuclear@0: nuclear@0: } TT_SBit_ComponentRec, *TT_SBit_Component; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TT_SBit_ScaleRec */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* A structure used describe a given bitmap scaling table, as defined */ nuclear@0: /* in the `EBSC' table. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* hori :: The horizontal line metrics. */ nuclear@0: /* */ nuclear@0: /* vert :: The vertical line metrics. */ nuclear@0: /* */ nuclear@0: /* x_ppem :: The number of horizontal pixels per EM. */ nuclear@0: /* */ nuclear@0: /* y_ppem :: The number of vertical pixels per EM. */ nuclear@0: /* */ nuclear@0: /* x_ppem_substitute :: Substitution x_ppem value. */ nuclear@0: /* */ nuclear@0: /* y_ppem_substitute :: Substitution y_ppem value. */ nuclear@0: /* */ nuclear@0: typedef struct TT_SBit_ScaleRec_ nuclear@0: { nuclear@0: TT_SBit_LineMetricsRec hori; nuclear@0: TT_SBit_LineMetricsRec vert; nuclear@0: nuclear@0: FT_Byte x_ppem; nuclear@0: FT_Byte y_ppem; nuclear@0: nuclear@0: FT_Byte x_ppem_substitute; nuclear@0: FT_Byte y_ppem_substitute; nuclear@0: nuclear@0: } TT_SBit_ScaleRec, *TT_SBit_Scale; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: /*** ***/ nuclear@0: /*** ***/ nuclear@0: /*** POSTSCRIPT GLYPH NAMES SUPPORT ***/ nuclear@0: /*** ***/ nuclear@0: /*** ***/ nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TT_Post_20Rec */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* Postscript names sub-table, format 2.0. Stores the PS name of */ nuclear@0: /* each glyph in the font face. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* num_glyphs :: The number of named glyphs in the table. */ nuclear@0: /* */ nuclear@0: /* num_names :: The number of PS names stored in the table. */ nuclear@0: /* */ nuclear@0: /* glyph_indices :: The indices of the glyphs in the names arrays. */ nuclear@0: /* */ nuclear@0: /* glyph_names :: The PS names not in Mac Encoding. */ nuclear@0: /* */ nuclear@0: typedef struct TT_Post_20Rec_ nuclear@0: { nuclear@0: FT_UShort num_glyphs; nuclear@0: FT_UShort num_names; nuclear@0: FT_UShort* glyph_indices; nuclear@0: FT_Char** glyph_names; nuclear@0: nuclear@0: } TT_Post_20Rec, *TT_Post_20; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TT_Post_25Rec */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* Postscript names sub-table, format 2.5. Stores the PS name of */ nuclear@0: /* each glyph in the font face. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* num_glyphs :: The number of glyphs in the table. */ nuclear@0: /* */ nuclear@0: /* offsets :: An array of signed offsets in a normal Mac */ nuclear@0: /* Postscript name encoding. */ nuclear@0: /* */ nuclear@0: typedef struct TT_Post_25_ nuclear@0: { nuclear@0: FT_UShort num_glyphs; nuclear@0: FT_Char* offsets; nuclear@0: nuclear@0: } TT_Post_25Rec, *TT_Post_25; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TT_Post_NamesRec */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* Postscript names table, either format 2.0 or 2.5. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* loaded :: A flag to indicate whether the PS names are loaded. */ nuclear@0: /* */ nuclear@0: /* format_20 :: The sub-table used for format 2.0. */ nuclear@0: /* */ nuclear@0: /* format_25 :: The sub-table used for format 2.5. */ nuclear@0: /* */ nuclear@0: typedef struct TT_Post_NamesRec_ nuclear@0: { nuclear@0: FT_Bool loaded; nuclear@0: nuclear@0: union nuclear@0: { nuclear@0: TT_Post_20Rec format_20; nuclear@0: TT_Post_25Rec format_25; nuclear@0: nuclear@0: } names; nuclear@0: nuclear@0: } TT_Post_NamesRec, *TT_Post_Names; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: /*** ***/ nuclear@0: /*** ***/ nuclear@0: /*** GX VARIATION TABLE SUPPORT ***/ nuclear@0: /*** ***/ nuclear@0: /*** ***/ nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: nuclear@0: nuclear@0: #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT nuclear@0: typedef struct GX_BlendRec_ *GX_Blend; nuclear@0: #endif nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: /*** ***/ nuclear@0: /*** ***/ nuclear@0: /*** EMBEDDED BDF PROPERTIES TABLE SUPPORT ***/ nuclear@0: /*** ***/ nuclear@0: /*** ***/ nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: nuclear@0: /* nuclear@0: * These types are used to support a `BDF ' table that isn't part of the nuclear@0: * official TrueType specification. It is mainly used in SFNT-based nuclear@0: * bitmap fonts that were generated from a set of BDF fonts. nuclear@0: * nuclear@0: * The format of the table is as follows. nuclear@0: * nuclear@0: * USHORT version `BDF ' table version number, should be 0x0001. nuclear@0: * USHORT strikeCount Number of strikes (bitmap sizes) in this table. nuclear@0: * ULONG stringTable Offset (from start of BDF table) to string nuclear@0: * table. nuclear@0: * nuclear@0: * This is followed by an array of `strikeCount' descriptors, having the nuclear@0: * following format. nuclear@0: * nuclear@0: * USHORT ppem Vertical pixels per EM for this strike. nuclear@0: * USHORT numItems Number of items for this strike (properties and nuclear@0: * atoms). Maximum is 255. nuclear@0: * nuclear@0: * This array in turn is followed by `strikeCount' value sets. Each nuclear@0: * `value set' is an array of `numItems' items with the following format. nuclear@0: * nuclear@0: * ULONG item_name Offset in string table to item name. nuclear@0: * USHORT item_type The item type. Possible values are nuclear@0: * 0 => string (e.g., COMMENT) nuclear@0: * 1 => atom (e.g., FONT or even SIZE) nuclear@0: * 2 => int32 nuclear@0: * 3 => uint32 nuclear@0: * 0x10 => A flag to indicate a properties. This nuclear@0: * is ORed with the above values. nuclear@0: * ULONG item_value For strings => Offset into string table without nuclear@0: * the corresponding double quotes. nuclear@0: * For atoms => Offset into string table. nuclear@0: * For integers => Direct value. nuclear@0: * nuclear@0: * All strings in the string table consist of bytes and are nuclear@0: * zero-terminated. nuclear@0: * nuclear@0: */ nuclear@0: nuclear@0: #ifdef TT_CONFIG_OPTION_BDF nuclear@0: nuclear@0: typedef struct TT_BDFRec_ nuclear@0: { nuclear@0: FT_Byte* table; nuclear@0: FT_Byte* table_end; nuclear@0: FT_Byte* strings; nuclear@0: FT_ULong strings_size; nuclear@0: FT_UInt num_strikes; nuclear@0: FT_Bool loaded; nuclear@0: nuclear@0: } TT_BDFRec, *TT_BDF; nuclear@0: nuclear@0: #endif /* TT_CONFIG_OPTION_BDF */ nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: /*** ***/ nuclear@0: /*** ***/ nuclear@0: /*** ORIGINAL TT_FACE CLASS DEFINITION ***/ nuclear@0: /*** ***/ nuclear@0: /*** ***/ nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: /*************************************************************************/ nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* This structure/class is defined here because it is common to the */ nuclear@0: /* following formats: TTF, OpenType-TT, and OpenType-CFF. */ nuclear@0: /* */ nuclear@0: /* Note, however, that the classes TT_Size and TT_GlyphSlot are not */ nuclear@0: /* shared between font drivers, and are thus defined in `ttobjs.h'. */ nuclear@0: /* */ nuclear@0: /*************************************************************************/ nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TT_Face */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* A handle to a TrueType face/font object. A TT_Face encapsulates */ nuclear@0: /* the resolution and scaling independent parts of a TrueType font */ nuclear@0: /* resource. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* The TT_Face structure is also used as a `parent class' for the */ nuclear@0: /* OpenType-CFF class (T2_Face). */ nuclear@0: /* */ nuclear@0: typedef struct TT_FaceRec_* TT_Face; nuclear@0: nuclear@0: nuclear@0: /* a function type used for the truetype bytecode interpreter hooks */ nuclear@0: typedef FT_Error nuclear@0: (*TT_Interpreter)( void* exec_context ); nuclear@0: nuclear@0: /* forward declaration */ nuclear@0: typedef struct TT_LoaderRec_* TT_Loader; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TT_Loader_GotoTableFunc */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* Seeks a stream to the start of a given TrueType table. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* face :: A handle to the target face object. */ nuclear@0: /* */ nuclear@0: /* tag :: A 4-byte tag used to name the table. */ nuclear@0: /* */ nuclear@0: /* stream :: The input stream. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* length :: The length of the table in bytes. Set to 0 if not */ nuclear@0: /* needed. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* FreeType error code. 0 means success. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* The stream cursor must be at the font file's origin. */ nuclear@0: /* */ nuclear@0: typedef FT_Error nuclear@0: (*TT_Loader_GotoTableFunc)( TT_Face face, nuclear@0: FT_ULong tag, nuclear@0: FT_Stream stream, nuclear@0: FT_ULong* length ); nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TT_Loader_StartGlyphFunc */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* Seeks a stream to the start of a given glyph element, and opens a */ nuclear@0: /* frame for it. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* loader :: The current TrueType glyph loader object. */ nuclear@0: /* */ nuclear@0: /* glyph index :: The index of the glyph to access. */ nuclear@0: /* */ nuclear@0: /* offset :: The offset of the glyph according to the */ nuclear@0: /* `locations' table. */ nuclear@0: /* */ nuclear@0: /* byte_count :: The size of the frame in bytes. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* FreeType error code. 0 means success. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* This function is normally equivalent to FT_STREAM_SEEK(offset) */ nuclear@0: /* followed by FT_FRAME_ENTER(byte_count) with the loader's stream, */ nuclear@0: /* but alternative formats (e.g. compressed ones) might use something */ nuclear@0: /* different. */ nuclear@0: /* */ nuclear@0: typedef FT_Error nuclear@0: (*TT_Loader_StartGlyphFunc)( TT_Loader loader, nuclear@0: FT_UInt glyph_index, nuclear@0: FT_ULong offset, nuclear@0: FT_UInt byte_count ); nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TT_Loader_ReadGlyphFunc */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* Reads one glyph element (its header, a simple glyph, or a */ nuclear@0: /* composite) from the loader's current stream frame. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* loader :: The current TrueType glyph loader object. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* FreeType error code. 0 means success. */ nuclear@0: /* */ nuclear@0: typedef FT_Error nuclear@0: (*TT_Loader_ReadGlyphFunc)( TT_Loader loader ); nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TT_Loader_EndGlyphFunc */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* Closes the current loader stream frame for the glyph. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* loader :: The current TrueType glyph loader object. */ nuclear@0: /* */ nuclear@0: typedef void nuclear@0: (*TT_Loader_EndGlyphFunc)( TT_Loader loader ); nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* TrueType Face Type */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TT_Face */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* The TrueType face class. These objects model the resolution and */ nuclear@0: /* point-size independent data found in a TrueType font file. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* root :: The base FT_Face structure, managed by the */ nuclear@0: /* base layer. */ nuclear@0: /* */ nuclear@0: /* ttc_header :: The TrueType collection header, used when */ nuclear@0: /* the file is a `ttc' rather than a `ttf'. */ nuclear@0: /* For ordinary font files, the field */ nuclear@0: /* `ttc_header.count' is set to 0. */ nuclear@0: /* */ nuclear@0: /* format_tag :: The font format tag. */ nuclear@0: /* */ nuclear@0: /* num_tables :: The number of TrueType tables in this font */ nuclear@0: /* file. */ nuclear@0: /* */ nuclear@0: /* dir_tables :: The directory of TrueType tables for this */ nuclear@0: /* font file. */ nuclear@0: /* */ nuclear@0: /* header :: The font's font header (`head' table). */ nuclear@0: /* Read on font opening. */ nuclear@0: /* */ nuclear@0: /* horizontal :: The font's horizontal header (`hhea' */ nuclear@0: /* table). This field also contains the */ nuclear@0: /* associated horizontal metrics table */ nuclear@0: /* (`hmtx'). */ nuclear@0: /* */ nuclear@0: /* max_profile :: The font's maximum profile table. Read on */ nuclear@0: /* font opening. Note that some maximum */ nuclear@0: /* values cannot be taken directly from this */ nuclear@0: /* table. We thus define additional fields */ nuclear@0: /* below to hold the computed maxima. */ nuclear@0: /* */ nuclear@0: /* vertical_info :: A boolean which is set when the font file */ nuclear@0: /* contains vertical metrics. If not, the */ nuclear@0: /* value of the `vertical' field is */ nuclear@0: /* undefined. */ nuclear@0: /* */ nuclear@0: /* vertical :: The font's vertical header (`vhea' table). */ nuclear@0: /* This field also contains the associated */ nuclear@0: /* vertical metrics table (`vmtx'), if found. */ nuclear@0: /* IMPORTANT: The contents of this field is */ nuclear@0: /* undefined if the `verticalInfo' field is */ nuclear@0: /* unset. */ nuclear@0: /* */ nuclear@0: /* num_names :: The number of name records within this */ nuclear@0: /* TrueType font. */ nuclear@0: /* */ nuclear@0: /* name_table :: The table of name records (`name'). */ nuclear@0: /* */ nuclear@0: /* os2 :: The font's OS/2 table (`OS/2'). */ nuclear@0: /* */ nuclear@0: /* postscript :: The font's PostScript table (`post' */ nuclear@0: /* table). The PostScript glyph names are */ nuclear@0: /* not loaded by the driver on face opening. */ nuclear@0: /* See the `ttpost' module for more details. */ nuclear@0: /* */ nuclear@0: /* cmap_table :: Address of the face's `cmap' SFNT table */ nuclear@0: /* in memory (it's an extracted frame). */ nuclear@0: /* */ nuclear@0: /* cmap_size :: The size in bytes of the `cmap_table' */ nuclear@0: /* described above. */ nuclear@0: /* */ nuclear@0: /* goto_table :: A function called by each TrueType table */ nuclear@0: /* loader to position a stream's cursor to */ nuclear@0: /* the start of a given table according to */ nuclear@0: /* its tag. It defaults to TT_Goto_Face but */ nuclear@0: /* can be different for strange formats (e.g. */ nuclear@0: /* Type 42). */ nuclear@0: /* */ nuclear@0: /* access_glyph_frame :: A function used to access the frame of a */ nuclear@0: /* given glyph within the face's font file. */ nuclear@0: /* */ nuclear@0: /* forget_glyph_frame :: A function used to forget the frame of a */ nuclear@0: /* given glyph when all data has been loaded. */ nuclear@0: /* */ nuclear@0: /* read_glyph_header :: A function used to read a glyph header. */ nuclear@0: /* It must be called between an `access' and */ nuclear@0: /* `forget'. */ nuclear@0: /* */ nuclear@0: /* read_simple_glyph :: A function used to read a simple glyph. */ nuclear@0: /* It must be called after the header was */ nuclear@0: /* read, and before the `forget'. */ nuclear@0: /* */ nuclear@0: /* read_composite_glyph :: A function used to read a composite glyph. */ nuclear@0: /* It must be called after the header was */ nuclear@0: /* read, and before the `forget'. */ nuclear@0: /* */ nuclear@0: /* sfnt :: A pointer to the SFNT service. */ nuclear@0: /* */ nuclear@0: /* psnames :: A pointer to the PostScript names service. */ nuclear@0: /* */ nuclear@0: /* hdmx :: The face's horizontal device metrics */ nuclear@0: /* (`hdmx' table). This table is optional in */ nuclear@0: /* TrueType/OpenType fonts. */ nuclear@0: /* */ nuclear@0: /* gasp :: The grid-fitting and scaling properties */ nuclear@0: /* table (`gasp'). This table is optional in */ nuclear@0: /* TrueType/OpenType fonts. */ nuclear@0: /* */ nuclear@0: /* pclt :: The `pclt' SFNT table. */ nuclear@0: /* */ nuclear@0: /* num_sbit_strikes :: The number of sbit strikes, i.e., bitmap */ nuclear@0: /* sizes, embedded in this font. */ nuclear@0: /* */ nuclear@0: /* sbit_strikes :: An array of sbit strikes embedded in this */ nuclear@0: /* font. This table is optional in a */ nuclear@0: /* TrueType/OpenType font. */ nuclear@0: /* */ nuclear@0: /* num_sbit_scales :: The number of sbit scales for this font. */ nuclear@0: /* */ nuclear@0: /* sbit_scales :: Array of sbit scales embedded in this */ nuclear@0: /* font. This table is optional in a */ nuclear@0: /* TrueType/OpenType font. */ nuclear@0: /* */ nuclear@0: /* postscript_names :: A table used to store the Postscript names */ nuclear@0: /* of the glyphs for this font. See the */ nuclear@0: /* file `ttconfig.h' for comments on the */ nuclear@0: /* TT_CONFIG_OPTION_POSTSCRIPT_NAMES option. */ nuclear@0: /* */ nuclear@0: /* num_locations :: The number of glyph locations in this */ nuclear@0: /* TrueType file. This should be */ nuclear@0: /* identical to the number of glyphs. */ nuclear@0: /* Ignored for Type 2 fonts. */ nuclear@0: /* */ nuclear@0: /* glyph_locations :: An array of longs. These are offsets to */ nuclear@0: /* glyph data within the `glyf' table. */ nuclear@0: /* Ignored for Type 2 font faces. */ nuclear@0: /* */ nuclear@0: /* glyf_len :: The length of the `glyf' table. Needed */ nuclear@0: /* for malformed `loca' tables. */ nuclear@0: /* */ nuclear@0: /* font_program_size :: Size in bytecodes of the face's font */ nuclear@0: /* program. 0 if none defined. Ignored for */ nuclear@0: /* Type 2 fonts. */ nuclear@0: /* */ nuclear@0: /* font_program :: The face's font program (bytecode stream) */ nuclear@0: /* executed at load time, also used during */ nuclear@0: /* glyph rendering. Comes from the `fpgm' */ nuclear@0: /* table. Ignored for Type 2 font fonts. */ nuclear@0: /* */ nuclear@0: /* cvt_program_size :: The size in bytecodes of the face's cvt */ nuclear@0: /* program. Ignored for Type 2 fonts. */ nuclear@0: /* */ nuclear@0: /* cvt_program :: The face's cvt program (bytecode stream) */ nuclear@0: /* executed each time an instance/size is */ nuclear@0: /* changed/reset. Comes from the `prep' */ nuclear@0: /* table. Ignored for Type 2 fonts. */ nuclear@0: /* */ nuclear@0: /* cvt_size :: Size of the control value table (in */ nuclear@0: /* entries). Ignored for Type 2 fonts. */ nuclear@0: /* */ nuclear@0: /* cvt :: The face's original control value table. */ nuclear@0: /* Coordinates are expressed in unscaled font */ nuclear@0: /* units. Comes from the `cvt ' table. */ nuclear@0: /* Ignored for Type 2 fonts. */ nuclear@0: /* */ nuclear@0: /* num_kern_pairs :: The number of kerning pairs present in the */ nuclear@0: /* font file. The engine only loads the */ nuclear@0: /* first horizontal format 0 kern table it */ nuclear@0: /* finds in the font file. Ignored for */ nuclear@0: /* Type 2 fonts. */ nuclear@0: /* */ nuclear@0: /* kern_table_index :: The index of the kerning table in the font */ nuclear@0: /* kerning directory. Ignored for Type 2 */ nuclear@0: /* fonts. */ nuclear@0: /* */ nuclear@0: /* interpreter :: A pointer to the TrueType bytecode */ nuclear@0: /* interpreters field is also used to hook */ nuclear@0: /* the debugger in `ttdebug'. */ nuclear@0: /* */ nuclear@0: /* unpatented_hinting :: If true, use only unpatented methods in */ nuclear@0: /* the bytecode interpreter. */ nuclear@0: /* */ nuclear@0: /* doblend :: A boolean which is set if the font should */ nuclear@0: /* be blended (this is for GX var). */ nuclear@0: /* */ nuclear@0: /* blend :: Contains the data needed to control GX */ nuclear@0: /* variation tables (rather like Multiple */ nuclear@0: /* Master data). */ nuclear@0: /* */ nuclear@0: /* extra :: Reserved for third-party font drivers. */ nuclear@0: /* */ nuclear@0: /* postscript_name :: The PS name of the font. Used by the */ nuclear@0: /* postscript name service. */ nuclear@0: /* */ nuclear@0: typedef struct TT_FaceRec_ nuclear@0: { nuclear@0: FT_FaceRec root; nuclear@0: nuclear@0: TTC_HeaderRec ttc_header; nuclear@0: nuclear@0: FT_ULong format_tag; nuclear@0: FT_UShort num_tables; nuclear@0: TT_Table dir_tables; nuclear@0: nuclear@0: TT_Header header; /* TrueType header table */ nuclear@0: TT_HoriHeader horizontal; /* TrueType horizontal header */ nuclear@0: nuclear@0: TT_MaxProfile max_profile; nuclear@0: #ifdef FT_CONFIG_OPTION_OLD_INTERNALS nuclear@0: FT_ULong max_components; /* stubbed to 0 */ nuclear@0: #endif nuclear@0: nuclear@0: FT_Bool vertical_info; nuclear@0: TT_VertHeader vertical; /* TT Vertical header, if present */ nuclear@0: nuclear@0: FT_UShort num_names; /* number of name records */ nuclear@0: TT_NameTableRec name_table; /* name table */ nuclear@0: nuclear@0: TT_OS2 os2; /* TrueType OS/2 table */ nuclear@0: TT_Postscript postscript; /* TrueType Postscript table */ nuclear@0: nuclear@0: FT_Byte* cmap_table; /* extracted `cmap' table */ nuclear@0: FT_ULong cmap_size; nuclear@0: nuclear@0: TT_Loader_GotoTableFunc goto_table; nuclear@0: nuclear@0: TT_Loader_StartGlyphFunc access_glyph_frame; nuclear@0: TT_Loader_EndGlyphFunc forget_glyph_frame; nuclear@0: TT_Loader_ReadGlyphFunc read_glyph_header; nuclear@0: TT_Loader_ReadGlyphFunc read_simple_glyph; nuclear@0: TT_Loader_ReadGlyphFunc read_composite_glyph; nuclear@0: nuclear@0: /* a typeless pointer to the SFNT_Interface table used to load */ nuclear@0: /* the basic TrueType tables in the face object */ nuclear@0: void* sfnt; nuclear@0: nuclear@0: /* a typeless pointer to the FT_Service_PsCMapsRec table used to */ nuclear@0: /* handle glyph names <-> unicode & Mac values */ nuclear@0: void* psnames; nuclear@0: nuclear@0: nuclear@0: /***********************************************************************/ nuclear@0: /* */ nuclear@0: /* Optional TrueType/OpenType tables */ nuclear@0: /* */ nuclear@0: /***********************************************************************/ nuclear@0: nuclear@0: /* horizontal device metrics */ nuclear@0: #ifdef FT_CONFIG_OPTION_OLD_INTERNALS nuclear@0: TT_HdmxRec hdmx; nuclear@0: #endif nuclear@0: nuclear@0: /* grid-fitting and scaling table */ nuclear@0: TT_GaspRec gasp; /* the `gasp' table */ nuclear@0: nuclear@0: /* PCL 5 table */ nuclear@0: TT_PCLT pclt; nuclear@0: nuclear@0: /* embedded bitmaps support */ nuclear@0: #ifdef FT_CONFIG_OPTION_OLD_INTERNALS nuclear@0: FT_ULong num_sbit_strikes; nuclear@0: TT_SBit_Strike sbit_strikes; nuclear@0: #endif nuclear@0: nuclear@0: FT_ULong num_sbit_scales; nuclear@0: TT_SBit_Scale sbit_scales; nuclear@0: nuclear@0: /* postscript names table */ nuclear@0: TT_Post_NamesRec postscript_names; nuclear@0: nuclear@0: nuclear@0: /***********************************************************************/ nuclear@0: /* */ nuclear@0: /* TrueType-specific fields (ignored by the OTF-Type2 driver) */ nuclear@0: /* */ nuclear@0: /***********************************************************************/ nuclear@0: nuclear@0: /* the glyph locations */ nuclear@0: #ifdef FT_CONFIG_OPTION_OLD_INTERNALS nuclear@0: FT_UShort num_locations_stub; nuclear@0: FT_Long* glyph_locations_stub; nuclear@0: #endif nuclear@0: nuclear@0: /* the font program, if any */ nuclear@0: FT_ULong font_program_size; nuclear@0: FT_Byte* font_program; nuclear@0: nuclear@0: /* the cvt program, if any */ nuclear@0: FT_ULong cvt_program_size; nuclear@0: FT_Byte* cvt_program; nuclear@0: nuclear@0: /* the original, unscaled, control value table */ nuclear@0: FT_ULong cvt_size; nuclear@0: FT_Short* cvt; nuclear@0: nuclear@0: #ifdef FT_CONFIG_OPTION_OLD_INTERNALS nuclear@0: /* the format 0 kerning table, if any */ nuclear@0: FT_Int num_kern_pairs; nuclear@0: FT_Int kern_table_index; nuclear@0: TT_Kern0_Pair kern_pairs; nuclear@0: #endif nuclear@0: nuclear@0: /* A pointer to the bytecode interpreter to use. This is also */ nuclear@0: /* used to hook the debugger for the `ttdebug' utility. */ nuclear@0: TT_Interpreter interpreter; nuclear@0: nuclear@0: #ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING nuclear@0: /* Use unpatented hinting only. */ nuclear@0: FT_Bool unpatented_hinting; nuclear@0: #endif nuclear@0: nuclear@0: /***********************************************************************/ nuclear@0: /* */ nuclear@0: /* Other tables or fields. This is used by derivative formats like */ nuclear@0: /* OpenType. */ nuclear@0: /* */ nuclear@0: /***********************************************************************/ nuclear@0: nuclear@0: FT_Generic extra; nuclear@0: nuclear@0: const char* postscript_name; nuclear@0: nuclear@0: /* since version 2.1.8, but was originally placed after */ nuclear@0: /* `glyph_locations_stub' */ nuclear@0: FT_ULong glyf_len; nuclear@0: nuclear@0: /* since version 2.1.8, but was originally placed before `extra' */ nuclear@0: #ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT nuclear@0: FT_Bool doblend; nuclear@0: GX_Blend blend; nuclear@0: #endif nuclear@0: nuclear@0: /* since version 2.2 */ nuclear@0: nuclear@0: FT_Byte* horz_metrics; nuclear@0: FT_ULong horz_metrics_size; nuclear@0: nuclear@0: FT_Byte* vert_metrics; nuclear@0: FT_ULong vert_metrics_size; nuclear@0: nuclear@0: FT_ULong num_locations; /* in broken TTF, gid > 0xFFFF */ nuclear@0: FT_Byte* glyph_locations; nuclear@0: nuclear@0: FT_Byte* hdmx_table; nuclear@0: FT_ULong hdmx_table_size; nuclear@0: FT_UInt hdmx_record_count; nuclear@0: FT_ULong hdmx_record_size; nuclear@0: FT_Byte* hdmx_record_sizes; nuclear@0: nuclear@0: FT_Byte* sbit_table; nuclear@0: FT_ULong sbit_table_size; nuclear@0: FT_UInt sbit_num_strikes; nuclear@0: nuclear@0: FT_Byte* kern_table; nuclear@0: FT_ULong kern_table_size; nuclear@0: FT_UInt num_kern_tables; nuclear@0: FT_UInt32 kern_avail_bits; nuclear@0: FT_UInt32 kern_order_bits; nuclear@0: nuclear@0: #ifdef TT_CONFIG_OPTION_BDF nuclear@0: TT_BDFRec bdf; nuclear@0: #endif /* TT_CONFIG_OPTION_BDF */ nuclear@0: nuclear@0: /* since 2.3.0 */ nuclear@0: FT_ULong horz_metrics_offset; nuclear@0: FT_ULong vert_metrics_offset; nuclear@0: nuclear@0: } TT_FaceRec; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* TT_GlyphZoneRec */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* A glyph zone is used to load, scale and hint glyph outline */ nuclear@0: /* coordinates. */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* memory :: A handle to the memory manager. */ nuclear@0: /* */ nuclear@0: /* max_points :: The maximal size in points of the zone. */ nuclear@0: /* */ nuclear@0: /* max_contours :: Max size in links contours of the zone. */ nuclear@0: /* */ nuclear@0: /* n_points :: The current number of points in the zone. */ nuclear@0: /* */ nuclear@0: /* n_contours :: The current number of contours in the zone. */ nuclear@0: /* */ nuclear@0: /* org :: The original glyph coordinates (font */ nuclear@0: /* units/scaled). */ nuclear@0: /* */ nuclear@0: /* cur :: The current glyph coordinates (scaled/hinted). */ nuclear@0: /* */ nuclear@0: /* tags :: The point control tags. */ nuclear@0: /* */ nuclear@0: /* contours :: The contours end points. */ nuclear@0: /* */ nuclear@0: /* first_point :: Offset of the current subglyph's first point. */ nuclear@0: /* */ nuclear@0: typedef struct TT_GlyphZoneRec_ nuclear@0: { nuclear@0: FT_Memory memory; nuclear@0: FT_UShort max_points; nuclear@0: FT_UShort max_contours; nuclear@0: FT_UShort n_points; /* number of points in zone */ nuclear@0: FT_Short n_contours; /* number of contours */ nuclear@0: nuclear@0: FT_Vector* org; /* original point coordinates */ nuclear@0: FT_Vector* cur; /* current point coordinates */ nuclear@0: FT_Vector* orus; /* original (unscaled) point coordinates */ nuclear@0: nuclear@0: FT_Byte* tags; /* current touch flags */ nuclear@0: FT_UShort* contours; /* contour end points */ nuclear@0: nuclear@0: FT_UShort first_point; /* offset of first (#0) point */ nuclear@0: nuclear@0: } TT_GlyphZoneRec, *TT_GlyphZone; nuclear@0: nuclear@0: nuclear@0: /* handle to execution context */ nuclear@0: typedef struct TT_ExecContextRec_* TT_ExecContext; nuclear@0: nuclear@0: /* glyph loader structure */ nuclear@0: typedef struct TT_LoaderRec_ nuclear@0: { nuclear@0: FT_Face face; nuclear@0: FT_Size size; nuclear@0: FT_GlyphSlot glyph; nuclear@0: FT_GlyphLoader gloader; nuclear@0: nuclear@0: FT_ULong load_flags; nuclear@0: FT_UInt glyph_index; nuclear@0: nuclear@0: FT_Stream stream; nuclear@0: FT_Int byte_len; nuclear@0: nuclear@0: FT_Short n_contours; nuclear@0: FT_BBox bbox; nuclear@0: FT_Int left_bearing; nuclear@0: FT_Int advance; nuclear@0: FT_Int linear; nuclear@0: FT_Bool linear_def; nuclear@0: FT_Bool preserve_pps; nuclear@0: FT_Vector pp1; nuclear@0: FT_Vector pp2; nuclear@0: nuclear@0: FT_ULong glyf_offset; nuclear@0: nuclear@0: /* the zone where we load our glyphs */ nuclear@0: TT_GlyphZoneRec base; nuclear@0: TT_GlyphZoneRec zone; nuclear@0: nuclear@0: TT_ExecContext exec; nuclear@0: FT_Byte* instructions; nuclear@0: FT_ULong ins_pos; nuclear@0: nuclear@0: /* for possible extensibility in other formats */ nuclear@0: void* other; nuclear@0: nuclear@0: /* since version 2.1.8 */ nuclear@0: FT_Int top_bearing; nuclear@0: FT_Int vadvance; nuclear@0: FT_Vector pp3; nuclear@0: FT_Vector pp4; nuclear@0: nuclear@0: /* since version 2.2.1 */ nuclear@0: FT_Byte* cursor; nuclear@0: FT_Byte* limit; nuclear@0: nuclear@0: } TT_LoaderRec; nuclear@0: nuclear@0: nuclear@0: FT_END_HEADER nuclear@0: nuclear@0: #endif /* __TTTYPES_H__ */ nuclear@0: nuclear@0: nuclear@0: /* END */