📄 truetype.h
字号:
/* Note : The type TT_Engine is not defined in "drivers/ttlib/ttobjs.h" *//* The TT_Face type is already defined in "drivers/ttlib/ttobjs.h" *//* We use the _TRUETYPE_ macro to prevent their redefinition when *//* _compiling_ the backwards-compatible layer called "oldapi.c" *//* */#ifndef _TRUETYPE_ /***********************************************************************/ /* */ /* <Type> TT_Face */ /* */ /* <Description> */ /* A handle to a TrueType face/font object. A TT_Face encapsulates */ /* the resolution and scaling independent parts of a TrueType font */ /* file. Instances (a.k.a. fontsizes) and glyph objects must be */ /* created from them before a glyph can be loaded in memory. */ /* */ /* They are created through TT_New_Face and destroyed with */ /* TT_Done_Face. This will destroy all instance and glyph objects */ /* */ typedef struct TT_FaceRec_* TT_Face;#endif /* _TRUETYPE_ */ /***********************************************************************/ /* */ /* <Type> TT_Instance */ /* */ /* <Description> */ /* A handle to a TrueType instance/fontsize object. A TT_Instance */ /* encapsulates all the resolution and scaling dependent part of */ /* a given font size, but doesn't contain any glyph. They must be */ /* used with glyph objects in order to load glyph objects from */ /* a TT file. */ /* */ /* They are created from face objects with TT_New_Instance, and */ /* destroyed with TT_Done_Instance */ /* */ /* A fresh new instance has a default resolution of 96x96 dpi, */ /* and a default point size of 10 pt. Each of these can be changed */ /* dynamically with various APIs defined below.. */ /* */ typedef struct TT_InstanceRec_* TT_Instance; /* Note: The TT_Instance type is not defined in "drivers/ttlib/ttobjs.h" */ /***********************************************************************/ /* */ /* <Type> TT_Glyph */ /* */ /* <Description> */ /* A handle to a TrueType glyph object. A glyph object acts as a */ /* container for any of the glyphs of a given face object. It */ /* encapsulates glyph metrics as well as outline space sized large */ /* enough to allow the loading of any glyph without further */ /* allocation. A glyph object doesn't contain any bitmap or */ /* pixmap data/buffer. */ /* */ /* They are created from face objects with TT_New_Glyph, and */ /* destroyed with TT_Done_Glyph */ /* */ /* One can create several glyph objects per face, and use */ /* a single instance to load multiple glyphs, even concurrently */ /* in thread-safe and reentrant modes.. */ /* */ typedef struct TT_GlyphRec_* TT_Glyph; /* Note: the TT_Glyph type is not defined in "drivers/ttlib/ttobjs.h" *//* The TT_CharMap type is already defined in "drivers/ttlib/ttobjs.h" *//* We use the _TRUETYPE_ macro to prevent their redefinition when *//* _compiling_ the backwards-compatible layer called "oldapi.c" *//* */#ifndef _TRUETYPE_ /***********************************************************************/ /* */ /* <Type> TT_CharMap */ /* */ /* <Description> */ /* A handle to a TrueType character mapping object. These objects */ /* are used to convert character codes in a specific locale or */ /* encoding into font/face glyph indexes. */ /* */ /* The list of character maps found within a face can be */ /* enumerated with API functions defined below. An CharMap object */ /* is created with TT_New_CharMap. They are destroyed automatically */ /* when their parent face objects are discarded. */ /* */ typedef struct TT_CharMapRec_* TT_CharMap; typedef long TT_Error;#endif /* _TRUETYPE_ */ EXPORT_DEF const TT_Instance TT_Null_Instance; /*******************************************************************/ /* */ /* Postscript Names extension */ /* */ /*******************************************************************/#define TT_Err_Invalid_Post_Table_Format 0x0B00#define TT_Err_Invalid_Post_Table 0x0B01 /* Initialise the Postscript Names extension */ EXPORT_DEF TT_Error TT_Init_Post_Extension( TT_Engine engine ); /* Load the Postscript Names table - notice that the 'post' parameter */ /* will be ignored in 2.0. */ EXPORT_DEF TT_Error TT_Load_PS_Names( TT_Face face, void* post ); /* Gets the postscript name of a single glyph */ EXPORT_DEF TT_Error TT_Get_PS_Name( TT_Face face, TT_UShort index, TT_String** PSname ); /*******************************************************************/ /* */ /* Embedded Bitmaps (sbits) extension */ /* */ /*******************************************************************/#ifndef _TRUETYPE_ /*************************************************************/ /* */ /* <Struct> TT_SBit_Metrics */ /* */ /* <Description> */ /* A structure used to hold the big metrics of a given */ /* glyph bitmap in a TrueType or OpenType font. These */ /* are usually found in the "EBDT" table. */ /* */ /* <Fields> */ /* height :: glyph height in pixels */ /* width :: glyph width in pixels */ /* */ /* horiBearingX :: horizontal left bearing */ /* horiBearingY :: horizontal top bearing */ /* horiAdvance :: horizontal advance */ /* */ /* vertBearingX :: vertical left bearing */ /* vertBearingY :: vertical top bearing */ /* vertAdvance :: vertical advance */ /* */ typedef struct TT_SBit_Metrics_ { TT_Byte height; TT_Byte width; TT_Char horiBearingX; TT_Char horiBearingY; TT_Byte horiAdvance; TT_Char vertBearingX; TT_Char vertBearingY; TT_Byte vertAdvance; } TT_SBit_Metrics; /*************************************************************/ /* */ /* <Struct> TT_SBit_Small_Metrics */ /* */ /* <Description> */ /* A structure used to hold the small metrics of a given */ /* glyph bitmap in a TrueType or OpenType font. These */ /* are usually found in the "EBDT" table. */ /* */ /* <Fields> */ /* height :: glyph height in pixels */ /* width :: glyph width in pixels */ /* */ /* bearingX :: left-side bearing */ /* bearingY :: top-side bearing */ /* advance :: advance width or height */ /* */ typedef struct TT_SBit_Small_Metrics_ { TT_Byte height; TT_Byte width; TT_Char bearingX; TT_Char bearingY; TT_Byte advance; } TT_SBit_Small_Metrics; /*************************************************************/ /* */ /* <Struct> TT_SBit_Line_Metrics */ /* */ /* <Description> */ /* A structure used to describe the text line metrics of */ /* a given bitmap strike, for either an horizontal or */ /* vertical layout. */ /* */ /* <Fields> */ /* ascender :: ascender in pixels */ /* descender :: descender in pixels */ /* max_width :: maximum glyph width in pixels */ /* */ /* caret_slope_enumerator :: ? */ /* caret_slope_denominator :: ? */ /* caret_offset :: ? */ /* */ /* min_origin_SB :: ? */ /* min_advance_SB :: ? */ /* max_before_BL :: ? */ /* min_after_BL :: ? */ /* */ typedef struct TT_SBit_Line_Metrics_ { TT_Char ascender; TT_Char descender; TT_Byte max_width; TT_Char caret_slope_numerator; TT_Char caret_slope_denominator; TT_Char caret_offset; TT_Char min_origin_SB; TT_Char min_advance_SB; TT_Char max_before_BL; TT_Char min_after_BL; TT_Char pads[2]; } TT_SBit_Line_Metrics; /*************************************************************/ /* */ /* <Struct> TT_SBit_Range */ /* */ /* <Description> */ /* A TrueType/OpenType subIndexTable as defined in the */ /* "EBLC" or "bloc" tables. */ /* */ /* <Fields> */ /* */ /* first_glyph :: first glyph index in range */ /* last_glyph :: last glyph index in range */ /* */ /* index_format :: format of index table. valid */ /* values are 1 to 5. */ /* */ /* image_format :: format of 'EBDT' image data */ /* image_offset :: offset to image data in 'EBDT' */ /* */ /* image_size :: for index formats 2 and 5. This is */ /* the size in bytes of each glyph bitmap */ /* glyph bitmap */ /* */ /* big_metrics :: for index formats 2 and 5. This is */ /* the big metrics for each glyph bitmap */ /* */ /* num_glyphs :: for index formats 4 and 5. This is */ /* the number of glyphs in the code */ /* array. */ /* */ /* glyph_offsets :: for index formats 1 and 3. */ /* glyph_codes :: for index formats 4 and 5. */ /* */ /* table_offset :: offset of index table in 'EBLC' table */ /* only used during strike loading.. */ /* */ typedef struct TT_SBit_Range { TT_UShort first_glyph; TT_UShort last_glyph; TT_UShort index_format; TT_UShort image_format; TT_ULong image_offset; TT_ULong image_size; TT_SBit_Metrics metrics; TT_ULong num_glyphs; TT_ULong* glyph_offsets; TT_UShort* glyph_codes; TT_ULong table_offset; } TT_SBit_Range;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -