Formatting.

Fixing documentation.
This commit is contained in:
Werner Lemberg 2000-07-19 06:25:56 +00:00
parent c8f9cf37d3
commit e1bbc017ce
6 changed files with 540 additions and 462 deletions

View File

@ -4,11 +4,11 @@
/* */
/* OpenType error ID definitions (specification only). */
/* */
/* Copyright 1996-1999 by */
/* Copyright 1996-2000 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
/* modified and distributed under the terms of the FreeType project */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
@ -19,6 +19,7 @@
#ifndef T2ERRORS_H
#define T2ERRORS_H
/*************************************************************************/
/* */
/* Error codes declaration */
@ -113,7 +114,8 @@
#define T2_Err_Could_Not_Find_Context 0x550
#endif /* FTERRID_H */
#endif /* T2ERRORS_H */
/* END */

View File

@ -5,14 +5,11 @@
/* Basic OpenType/CFF type definitions and interface (specification */
/* only). */
/* */
/* This code is used by the OpenType/CFF driver. */
/* */
/* */
/* Copyright 1996-2000 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
/* modified and distributed under the terms of the FreeType project */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
@ -27,24 +24,28 @@
#include <freetype/freetype.h>
/*************************************************************************
*
* <Struct>
* CFF_Index
*
* <Description>
* A structure used to model a CFF Index table
*
* <Fields>
* count :: number of elements in index
* off_size :: size in bytes of object offsets in index
* data_offset :: position of first data byte in the index's bytes
*
* total_size :: total_size of index in bytes
* bytes :: when the index is loaded in memory, its bytes
* file_offset :: position of index in file. The offset table starts
* at file_offset + 3
*/
/*************************************************************************/
/* */
/* <Struct> */
/* CFF_Index */
/* */
/* <Description> */
/* A structure used to model a CFF Index table. */
/* */
/* <Fields> */
/* stream :: XXX */
/* */
/* count :: The number of elements in the index. */
/* */
/* off_size :: The size in bytes of object offsets in index. */
/* */
/* data_offset :: The position of first data byte in the index's */
/* bytes. */
/* */
/* offsets :: XXX */
/* */
/* bytes :: If the index is loaded in memory, its bytes. */
/* */
typedef struct CFF_Index_
{
FT_Stream stream;
@ -86,7 +87,7 @@
FT_UInt base_font_name;
FT_UInt postscript;
/* these should only be used for the top-level font dict */
/* these should only be used for the top-level font dictionary */
FT_UInt cid_registry;
FT_UInt cid_ordering;
FT_ULong cid_supplement;
@ -103,7 +104,6 @@
} CFF_Font_Dict;
typedef struct CFF_Private_
{
FT_Byte num_blue_values;
@ -144,7 +144,7 @@
FT_Byte format;
FT_UInt range_count;
/* that's the table, taken from the file 'as is' */
/* that's the table, taken from the file `as is' */
FT_Byte* data;
FT_UInt data_size;
@ -156,9 +156,8 @@
} CFF_FD_Select;
/* a SubFont packs a font dict and a private dict together. They're */
/* needed to support CID-keyde CFF fonts.. */
/* A SubFont packs a font dict and a private dict together. They are */
/* needed to support CID-keyed CFF fonts. */
typedef struct CFF_SubFont_
{
CFF_Font_Dict font_dict;
@ -174,6 +173,7 @@
/* maximum number of sub-fonts in a CID-keyed file */
#define CFF_MAX_CID_FONTS 16
typedef struct CFF_Font_
{
FT_Stream stream;

View File

@ -7,8 +7,8 @@
/* Copyright 1996-2000 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
/* modified and distributed under the terms of the FreeType project */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
@ -114,7 +114,8 @@
#define TT_Err_Could_Not_Find_Context 0x450
#endif /* FTERRID_H */
#endif /* TTERRORS_H */
/* END */

View File

@ -5,14 +5,11 @@
/* Basic SFNT/TrueType type definitions and interface (specification */
/* only). */
/* */
/* This code is shared by all TrueType and OpenType drivers. */
/* */
/* */
/* Copyright 1996-2000 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
/* modified and distributed under the terms of the FreeType project */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
@ -51,19 +48,22 @@
/* */
/* <Fields> */
/* tag :: Must be `ttc ' to indicate a TrueType collection. */
/* */
/* version :: The version number. */
/* */
/* count :: The number of faces in the collection. The */
/* specification says this should be an unsigned long, but */
/* we use a signed long since we need the value -1 for */
/* specific purposes. */
/* */
/* offsets :: The offsets of the font headers, one per face. */
/* */
typedef struct TTC_Header_
{
FT_ULong Tag;
FT_ULong tag;
FT_Fixed version;
FT_Long DirCount;
FT_ULong* TableDirectory;
FT_Long count;
FT_ULong* offsets;
} TTC_Header;
@ -77,11 +77,15 @@
/* SFNT file format header. */
/* */
/* <Fields> */
/* format_tag :: font format tag.. */
/* num_tables :: number of tables in file */
/* search_range :: must be 16*(max power of 2 <= num_tables) */
/* entry_selector :: log2 of search_range/16 */
/* range_shift :: must be num_tables*16 - search_range */
/* format_tag :: The font format tag. */
/* */
/* num_tables :: The number of tables in file. */
/* */
/* search_range :: Must be 16*(max power of 2 <= num_tables). */
/* */
/* entry_selector :: Must be log2 of search_range/16. */
/* */
/* range_shift :: Must be num_tables*16 - search_range. */
/* */
typedef struct SFNT_Header_
{
@ -93,6 +97,7 @@
} SFNT_Header;
/*************************************************************************/
/* */
/* <Struct> */
@ -104,10 +109,13 @@
/* */
/* <Fields> */
/* version :: The version number; starts with 0x00010000. */
/* */
/* numTables :: The number of tables. */
/* */
/* searchRange :: Unused. */
/* */
/* entrySelector :: Unused. */
/* */
/* rangeShift :: Unused. */
/* */
/* <Note> */
@ -135,9 +143,12 @@
/* */
/* <Fields> */
/* Tag :: A four-bytes tag describing the table. */
/* */
/* CheckSum :: The table checksum. This value can be ignored. */
/* */
/* Offset :: The offset of the table from the start of the TrueType */
/* font in its resource. */
/* */
/* Length :: The table length (in bytes). */
/* */
typedef struct TT_Table_
@ -161,6 +172,7 @@
/* */
/* <Fields> */
/* tableVersionNumber :: The version number. */
/* */
/* numCMaps :: The number of charmaps in the font. */
/* */
/* <Note> */
@ -215,6 +227,7 @@
/* */
/* <Fields> */
/* advance :: The advance width or height for the glyph. */
/* */
/* bearing :: The left-side or top-side bearing for the glyph. */
/* */
typedef struct TT_LongMetrics_
@ -362,7 +375,9 @@
/* */
/* <Fields> */
/* version :: The version number. */
/* */
/* numRanges :: The number of gasp ranges in table. */
/* */
/* gaspRanges :: An array of gasp ranges. */
/* */
typedef struct TT_Gasp_
@ -381,7 +396,7 @@
/* */
/* <Description> */
/* A small structure used to model the pre-computed widths of a given */
/* size. They're found in the `hdmx' table. */
/* size. They are found in the `hdmx' table. */
/* */
/* <Fields> */
/* ppem :: The pixels per EM value at which these metrics apply. */
@ -402,7 +417,7 @@
/*************************************************************************/
/* */
/* <Struct> */
/* TT_HdmxRec */
/* TT_Hdmx */
/* */
/* <Description> */
/* A structure used to model the `hdmx' table, which contains */
@ -410,7 +425,9 @@
/* */
/* <Fields> */
/* version :: The version number. */
/* */
/* num_records :: The number of hdmx records. */
/* */
/* records :: An array of hdmx records. */
/* */
typedef struct TT_Hdmx_
@ -434,7 +451,9 @@
/* */
/* <Fields> */
/* left :: The index of the left glyph in pair. */
/* */
/* right :: The index of the right glyph in pair. */
/* */
/* value :: The kerning distance. A positive value spaces the */
/* glyphs, a negative one makes them closer. */
/* */
@ -446,6 +465,7 @@
} TT_Kern_0_Pair;
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
@ -458,6 +478,7 @@
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/* */
/* <Struct> */
@ -582,6 +603,9 @@
/* */
/* vertBearingX - width */
/* */
/* pads :: Unused (to make the size of the record */
/* a multiple of 32 bits. */
/* */
typedef struct TT_SBit_Line_Metrics_
{
FT_Char ascender;
@ -723,7 +747,9 @@
/* */
/* <Fields> */
/* glyph_code :: The element's glyph index. */
/* */
/* x_offset :: The element's left bearing. */
/* */
/* y_offset :: The element's top bearing. */
/* */
typedef struct TT_SBit_Component_
@ -771,6 +797,7 @@
} TT_SBit_Scale;
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
@ -783,6 +810,7 @@
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/* */
/* <Struct> */
@ -862,6 +890,7 @@
} TT_Post_Names;
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
@ -874,7 +903,9 @@
/*************************************************************************/
/*************************************************************************/
/* format 0 */
typedef struct TT_CMap0_
{
FT_Byte* glyphIdArray;
@ -883,6 +914,7 @@
/* format 2 */
typedef struct TT_CMap2SubHeader_
{
FT_UShort firstCode; /* first valid low byte */
@ -907,6 +939,7 @@
/* format 4 */
typedef struct TT_CMap4Segment_
{
FT_UShort endCount;
@ -928,12 +961,13 @@
FT_UShort* glyphIdArray;
FT_UShort numGlyphId; /* control value */
TT_CMap4Segment* last_segment; /* last used segment, this is a small */
TT_CMap4Segment* last_segment; /* last used segment; this is a small */
/* cache to potentially increase speed */
} TT_CMap4;
/* format 6 */
typedef struct TT_CMap6_
{
FT_UShort firstCode; /* first character code of subrange */
@ -943,12 +977,15 @@
} TT_CMap6;
typedef struct TT_CMapTable_ TT_CMapTable;
typedef
FT_UInt (*TT_CharMap_Func)( TT_CMapTable* charmap,
FT_ULong char_code );
/* charmap table */
struct TT_CMapTable_
{
@ -983,6 +1020,7 @@
/* */
/* <Fields> */
/* root :: The parent character map structure. */
/* */
/* cmap :: The used character map. */
/* */
typedef struct TT_CharMapRec_
@ -1011,12 +1049,13 @@
/* This structure/class is defined here because it is common to the */
/* following formats: TTF, OpenType-TT, and OpenType-CFF. */
/* */
/* Note however that the classes TT_Size, TT_GlyphSlot, and TT_CharMap */
/* Note, however, that the classes TT_Size, TT_GlyphSlot, and TT_CharMap */
/* are not shared between font drivers, and are thus defined normally in */
/* `drivers/truetype/ttobjs.h'. */
/* `ttobjs.h'. */
/* */
/*************************************************************************/
/*************************************************************************/
/* */
/* <Type> */
@ -1051,6 +1090,7 @@
/* forward declaration */
typedef struct TT_Loader_ TT_Loader;
/*************************************************************************/
/* */
/* <FuncType> */
@ -1061,17 +1101,20 @@
/* */
/* <Input> */
/* face :: A handle to the target face object. */
/* tag :: a 4-byte tag used to name the table */
/* */
/* tag :: A 4-byte tag used to name the table. */
/* */
/* stream :: The input stream. */
/* */
/* <Output> */
/* length :: length of table in bytes. Set to 0 when not needed */
/* length :: The length of the table in bytes. Set to 0 if not */
/* needed. */
/* */
/* <Return> */
/* TrueType error code. 0 means success. */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* The stream cursor must be at the font file's origin */
/* The stream cursor must be at the font file's origin. */
/* */
typedef
FT_Error (*TT_Goto_Table_Func)( TT_Face face,
@ -1079,29 +1122,34 @@
FT_Stream stream,
FT_ULong* length );
/*************************************************************************/
/* */
/* <FuncType> */
/* TT_Access_Glyph_Frame */
/* TT_Access_Glyph_Frame_Func */
/* */
/* <Description> */
/* Seeks a stream to the start of a given glyph element, and */
/* opens a frame for it.. */
/* Seeks a stream to the start of a given glyph element, and opens a */
/* frame for it. */
/* */
/* <Input> */
/* loader :: the current TrueType glyph loader object */
/* glyph index :: index of glyph to access */
/* offset :: offset of glyph according to locations table */
/* byte_count :: size of frame in bytes */
/* loader :: The current TrueType glyph loader object. */
/* */
/* glyph index :: The index of the glyph to access. */
/* */
/* offset :: The offset of the glyph according to the */
/* `locations' table. */
/* */
/* byte_count :: The size of the frame in bytes. */
/* */
/* <Return> */
/* TrueType error code. 0 means success. */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* This function is normally equivalent to FILE_Seek(offset) */
/* followed by ACCESS_Frame(byte_count) with the loader's stream */
/* but alternative formats (compressed ones) might use something */
/* different.. */
/* followed by ACCESS_Frame(byte_count) with the loader's stream, but */
/* alternative formats (e.g. compressed ones) might use something */
/* different. */
/* */
typedef
FT_Error (*TT_Access_Glyph_Frame_Func)( TT_Loader* loader,
@ -1109,34 +1157,36 @@
FT_ULong offset,
FT_UInt byte_count );
/*************************************************************************/
/* */
/* <FuncType> */
/* TT_Load_Glyph_Element */
/* */
/* <Description> */
/* Reads one glyph element (its header, a simple glyph, or a */
/* composite) from the loader's current stream frame.. */
/* */
/* <Input> */
/* loader :: the current TrueType glyph loader object */
/* */
/* <Return> */
/* TrueType error code. 0 means success. */
/* */
typedef
FT_Error (*TT_Load_Glyph_Element_Func)( TT_Loader* loader );
/*************************************************************************/
/* */
/* <FuncType> */
/* TT_Forget_Frame_Element */
/* TT_Load_Glyph_Element_Func */
/* */
/* <Description> */
/* Closes the current loader stream frame for the glyph.. */
/* Reads one glyph element (its header, a simple glyph, or a */
/* composite) from the loader's current stream frame. */
/* */
/* <Input> */
/* loader :: the current TrueType glyph loader object */
/* loader :: The current TrueType glyph loader object. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
typedef
FT_Error (*TT_Load_Glyph_Element_Func)( TT_Loader* loader );
/*************************************************************************/
/* */
/* <FuncType> */
/* TT_Forget_Glyph_Frame_Func */
/* */
/* <Description> */
/* Closes the current loader stream frame for the glyph. */
/* */
/* <Input> */
/* loader :: The current TrueType glyph loader object. */
/* */
typedef
void (*TT_Forget_Glyph_Frame_Func)( TT_Loader* loader );
@ -1158,10 +1208,12 @@
/* root :: The base FT_Face structure, managed by the */
/* base layer. */
/* */
/* ttcHeader :: The TrueType collection header, used when the */
/* file is a `ttc' rather than a `ttf'. For */
/* ordinary font files, the field */
/* `ttcHeader.DirCount' is set to 0. */
/* ttc_header :: The TrueType collection header, used when */
/* the file is a `ttc' rather than a `ttf'. */
/* For ordinary font files, the field */
/* `ttc_header.count' is set to 0. */
/* */
/* format_tag :: The font format tag. */
/* */
/* num_tables :: The number of TrueType tables in this font */
/* file. */
@ -1169,26 +1221,28 @@
/* dir_tables :: The directory of TrueType tables for this */
/* font file. */
/* */
/* header :: The font's font header (`head' table). Read */
/* on font opening. */
/* header :: The font's font header (`head' table). */
/* Read on font opening. */
/* */
/* horizontal :: The font's horizontal header (`hhea' table). */
/* This field also contains the associated */
/* horizontal metrics table (`hmtx'). */
/* horizontal :: The font's horizontal header (`hhea' */
/* table). This field also contains the */
/* associated horizontal metrics table */
/* (`hmtx'). */
/* */
/* max_profile :: The font's maximum profile table. Read on */
/* font opening. Note that some maximum values */
/* cannot be taken directly from this table. We */
/* thus define additional fields below to hold */
/* the computed maxima. */
/* font opening. Note that some maximum */
/* values cannot be taken directly from this */
/* table. We thus define additional fields */
/* below to hold the computed maxima. */
/* */
/* max_components :: The maximum number of glyph components */
/* required to load any composite glyph from */
/* this font. Used to size the load stack. */
/* */
/* vertical_info :: A boolean which is set when the font file */
/* contains vertical metrics. If not, the value */
/* of the `vertical' field is undefined. */
/* contains vertical metrics. If not, the */
/* value of the `vertical' field is */
/* undefined. */
/* */
/* vertical :: The font's vertical header (`vhea' table). */
/* This field also contains the associated */
@ -1204,12 +1258,13 @@
/* */
/* os2 :: The font's OS/2 table (`OS/2'). */
/* */
/* postscript :: The font's PostScript table (`post' table). */
/* The PostScript glyph names are not loaded by */
/* the driver on face opening. See the `ttpost' */
/* module for more details. */
/* postscript :: The font's PostScript table (`post' */
/* table). The PostScript glyph names are */
/* not loaded by the driver on face opening. */
/* See the `ttpost' module for more details. */
/* */
/* num_charmaps :: The number of character mappings in the font. */
/* num_charmaps :: The number of character mappings in the */
/* font. */
/* */
/* charmaps :: The array of charmap objects for this font */
/* file. Note that this field is a typeless */
@ -1217,22 +1272,38 @@
/* charmaps varies with the underlying font */
/* format and cannot be determined here. */
/* */
/* goto_face :: a function called by each TrueType table */
/* loader to position a stream's cursor to the */
/* start of a given table according to its tag. */
/* it defaults to TT_Goto_Face but can be */
/* different for strange formats (e.g. Type 42) */
/* goto_table :: A function called by each TrueType table */
/* loader to position a stream's cursor to */
/* the start of a given table according to */
/* its tag. It defaults to TT_Goto_Face but */
/* can be different for strange formats (e.g. */
/* Type 42). */
/* */
/* sfnt :: a pointer to the SFNT `driver' interface. */
/* access_glyph_frame :: XXX */
/* */
/* hdmx :: The face's horizontal device metrics (`hdmx' */
/* table). This table is optional in */
/* read_glyph_header :: XXX */
/* */
/* read_simple_glyph :: XXX */
/* */
/* read_composite_glyph :: XXX */
/* */
/* forget_glyph_frame :: XXX */
/* */
/* sfnt :: A pointer to the SFNT `driver' interface. */
/* */
/* psnames :: A pointer to the `PSNames' module */
/* interface. */
/* */
/* hdmx :: The face's horizontal device metrics */
/* (`hdmx' table). This table is optional in */
/* TrueType/OpenType fonts. */
/* */
/* gasp :: The grid-fitting and scaling properties table */
/* (`gasp'). This table is optional in */
/* gasp :: The grid-fitting and scaling properties */
/* table (`gasp'). This table is optional in */
/* TrueType/OpenType fonts. */
/* */
/* pclt :: XXX */
/* */
/* num_sbit_strikes :: The number of sbit strikes, i.e., bitmap */
/* sizes, embedded in this font. */
/* */
@ -1242,66 +1313,67 @@
/* */
/* num_sbit_scales :: The number of sbit scales for this font. */
/* */
/* sbit_scales :: Array of sbit scales embedded in this font. */
/* This table is optional in a TrueType/OpenType */
/* font. */
/* sbit_scales :: Array of sbit scales embedded in this */
/* font. This table is optional in a */
/* TrueType/OpenType font. */
/* */
/* postscript_names :: A table used to store the Postscript names of */
/* the glyphs for this font. See the file */
/* `ttconfig.h' for comments on the */
/* postscript_names :: A table used to store the Postscript names */
/* of the glyphs for this font. See the */
/* file `ttconfig.h' for comments on the */
/* TT_CONFIG_OPTION_POSTSCRIPT_NAMES option. */
/* */
/* num_locations :: The number of glyph locations in this */
/* TrueType file. This should be identical to */
/* the number of glyphs. Ignored for Type 2 */
/* fonts. */
/* TrueType file. This should be */
/* identical to the number of glyphs. */
/* Ignored for Type 2 fonts. */
/* */
/* glyph_locations :: An array of longs. These are offsets to */
/* glyph data within the `glyf' table. Ignored */
/* for Type 2 font faces. */
/* glyph data within the `glyf' table. */
/* Ignored for Type 2 font faces. */
/* */
/* font_program_size :: Size in bytecodes of the face's font program. */
/* 0 if none defined. Ignored for Type 2 fonts. */
/* font_program_size :: Size in bytecodes of the face's font */
/* program. 0 if none defined. Ignored for */
/* Type 2 fonts. */
/* */
/* font_program :: The face's font program (bytecode stream) */
/* executed at load time, also used during glyph */
/* rendering. Comes from the `fpgm' table. */
/* Ignored for Type 2 font fonts. */
/* executed at load time, also used during */
/* glyph rendering. Comes from the `fpgm' */
/* table. Ignored for Type 2 font fonts. */
/* */
/* cvt_program_size :: Size in bytecodes of the face's cvt program. */
/* Ignored for Type 2 fonts. */
/* cvt_program_size :: The size in bytecodes of the face's cvt */
/* program. Ignored for Type 2 fonts. */
/* */
/* cvt_program :: The face's cvt program (bytecode stream) */
/* executed each time an instance/size is */
/* changed/reset. Comes from the `prep' table. */
/* Ignored for Type 2 fonts. */
/* changed/reset. Comes from the `prep' */
/* table. Ignored for Type 2 fonts. */
/* */
/* cvt_size :: Size of the control value table (in entries). */
/* Ignored for Type 2 fonts. */
/* cvt_size :: Size of the control value table (in */
/* entries). Ignored for Type 2 fonts. */
/* */
/* cvt :: The face's original control value table. */
/* Coordinates are expressed in unscaled font */
/* units. Comes from the `cvt ` table. Ignored */
/* for Type 2 fonts. */
/* units. Comes from the `cvt ' table. */
/* Ignored for Type 2 fonts. */
/* */
/* num_kern_pairs :: The number of kerning pairs present in the */
/* font file. The engine only loads the first */
/* horizontal format 0 kern table it finds in */
/* the font file. You should use the `ttxkern' */
/* structures if you want to access other */
/* kerning tables. Ignored for Type 2 fonts. */
/* */
/* kern_table_index :: The index of the kerning table in the font */
/* kerning directory. Only used by the ttxkern */
/* extension to avoid data duplication. Ignored */
/* font file. The engine only loads the */
/* first horizontal format 0 kern table it */
/* finds in the font file. You should use */
/* the `ttxkern' structures if you want to */
/* access other kerning tables. Ignored */
/* for Type 2 fonts. */
/* */
/* kern_pairs :: Array of kerning pairs, if any. Ignored for */
/* Type 2 fonts. */
/* kern_table_index :: The index of the kerning table in the font */
/* kerning directory. Only used by the */
/* ttxkern extension to avoid data */
/* duplication. Ignored for Type 2 fonts. */
/* */
/* interpreter :: Pointer to the TrueType bytecode interpreter */
/* this field is also used to hook the debugger */
/* in `ttdebug' */
/* interpreter :: A pointer to the TrueType bytecode */
/* interpreters field is also used to hook */
/* the debugger in `ttdebug'. */
/* */
/* extra :: XXX */
/* */
typedef struct TT_FaceRec_
{
@ -1331,10 +1403,6 @@
FT_Int num_charmaps;
TT_CharMap charmaps; /* array of TT_CharMapRec */
/* a pointer to the function used to seek a stream to the start of */
/* a given TrueType table. This should default to the function */
/* TT_Goto_Table defined in `ttload.h', but some font drivers */
/* might need something different, e.g. Type 42 fonts */
TT_Goto_Table_Func goto_table;
TT_Access_Glyph_Frame_Func access_glyph_frame;
@ -1376,6 +1444,7 @@
/* postscript names table */
TT_Post_Names postscript_names;
/***********************************************************************/
/* */
/* TrueType-specific fields (ignored by the OTF-Type2 driver) */
@ -1403,10 +1472,11 @@
FT_Int kern_table_index;
TT_Kern_0_Pair* kern_pairs;
/* a pointer to the bytecode interpreter to use. This is also */
/* used to hook the debugger for the `ttdebug' utility.. */
/* A pointer to the bytecode interpreter to use. This is also */
/* used to hook the debugger for the `ttdebug' utility. */
TT_Interpreter interpreter;
/***********************************************************************/
/* */
/* Other tables or fields. This is used by derivative formats like */
@ -1419,30 +1489,35 @@
} TT_FaceRec;
/************************************************************************
*
* <Struct>
* TT_GlyphZone
*
* <Description>
* A glyph zone is used to load, scale and hint glyph outline
* coordinates.
*
* <Fields>
* memory :: handle to memory manager
* max_points :: max size in points of zone
* max_contours :: max size in contours of zone
* n_points :: current number of points in zone
* n_contours :: current number of contours in zone
* org :: original glyph coordinates (font units/scaled)
* cur :: current glyph coordinates (scaled/hinted)
* tags :: point control tags
* contours :: contour end points
*
***********************************************************************/
/*************************************************************************/
/* */
/* <Struct> */
/* TT_GlyphZone */
/* */
/* <Description> */
/* A glyph zone is used to load, scale and hint glyph outline */
/* coordinates. */
/* */
/* <Fields> */
/* memory :: A handle to the memory manager. */
/* */
/* max_points :: The maximal size in points of the zone. */
/* */
/* max_contours :: Max size in links contours of thez one. */
/* */
/* n_points :: The current number of points in the zone. */
/* */
/* n_contours :: The current number of contours in the zone. */
/* */
/* org :: The original glyph coordinates (font */
/* units/scaled). */
/* */
/* cur :: The current glyph coordinates (scaled/hinted). */
/* */
/* tags :: The point control tags. */
/* */
/* contours :: The contours end points. */
/* */
typedef struct TT_GlyphZone_
{
FT_Memory memory;

View File

@ -232,7 +232,7 @@
if ( error )
goto Exit;
face->root.num_faces = face->ttc_header.DirCount;
face->root.num_faces = face->ttc_header.count;
if ( face->root.num_faces < 1 )
face->root.num_faces = 1;
@ -493,8 +493,8 @@
face->num_kern_pairs = 0;
/* freeing the collection table */
FREE( face->ttc_header.TableDirectory );
face->ttc_header.DirCount = 0;
FREE( face->ttc_header.offsets );
face->ttc_header.count = 0;
/* freeing table directory */
FREE( face->dir_tables );

View File

@ -185,16 +185,16 @@
{
FT_FRAME_START( 8 ),
FT_FRAME_LONG( TTC_Header, version ),
FT_FRAME_LONG( TTC_Header, DirCount ),
FT_FRAME_LONG( TTC_Header, count ),
FT_FRAME_END };
FT_TRACE2(( "TT_Load_SFNT_Header: %08p, %ld\n",
face, face_index ));
face->ttc_header.Tag = 0;
face->ttc_header.tag = 0;
face->ttc_header.version = 0;
face->ttc_header.DirCount = 0;
face->ttc_header.count = 0;
face->num_tables = 0;
@ -217,26 +217,26 @@
goto Exit;
/* now read the offsets of each font in the file */
if ( ALLOC_ARRAY( face->ttc_header.TableDirectory,
face->ttc_header.DirCount,
if ( ALLOC_ARRAY( face->ttc_header.offsets,
face->ttc_header.count,
FT_ULong ) ||
ACCESS_Frame( face->ttc_header.DirCount * 4L ) )
ACCESS_Frame( face->ttc_header.count * 4L ) )
goto Exit;
for ( n = 0; n < face->ttc_header.DirCount; n++ )
face->ttc_header.TableDirectory[n] = GET_ULong();
for ( n = 0; n < face->ttc_header.count; n++ )
face->ttc_header.offsets[n] = GET_ULong();
FORGET_Frame();
/* check face index */
if ( face_index >= face->ttc_header.DirCount )
if ( face_index >= face->ttc_header.count )
{
error = TT_Err_Bad_Argument;
goto Exit;
}
/* seek to the appropriate TrueType file, then read tag */
if ( FILE_Seek( face->ttc_header.TableDirectory[face_index] ) ||
if ( FILE_Seek( face->ttc_header.offsets[face_index] ) ||
READ_Long( format_tag ) )
goto Exit;
}