diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h index 18659dbc6..8eb510adf 100644 --- a/include/freetype/freetype.h +++ b/include/freetype/freetype.h @@ -199,6 +199,30 @@ FT_BEGIN_HEADER } FT_Glyph_Metrics; + /*************************************************************************/ + /* */ + /* */ + /* FT_Basic_Glyph_Metrics */ + /* */ + /* */ + /* A small glyph metrics structure used to return information */ + /* for incrementally defined fonts (see FT_Incremental_Interface). */ + /* */ + /* */ + /* bearing_x :: Left side bearing in font units. */ + /* */ + /* bearing_y :: Top side bearing in font units. */ + /* */ + /* advance :: Advance in font units. */ + /* */ + typedef struct FT_Basic_Glyph_Metrics_ + { + FT_Long bearing_x; + FT_Long bearing_y; + FT_Long advance; + } FT_Basic_Glyph_Metrics; + + /*************************************************************************/ /* */ /* */ @@ -478,6 +502,111 @@ FT_BEGIN_HEADER } FT_CharMapRec; + + /*************************************************************************/ + /* */ + /* */ + /* FT_Get_Glyph_Data_Func */ + /* */ + /* */ + /* A type definition for a function to get glyph data from a */ + /* face that supplies glyph data incrementally, after the face */ + /* object has been created */ + /* */ + /* */ + /* object :: a pointer to the user's data, specified by the 'object' */ + /* field in FT_Incremental_Interface */ + /* */ + /* index :: the glyph index */ + /* */ + /* */ + /* data :: the position and length of the data */ + /* */ + /* */ + /* a standard error code */ + /* */ + typedef FT_Error (*FT_Get_Glyph_Data_Func)(void* object,FT_UInt index,FT_Data* data); + + + /*************************************************************************/ + /* */ + /* */ + /* FT_Get_Glyph_Metrics_Func */ + /* */ + /* */ + /* A type definition for a function to get glyph metrics from a */ + /* face that supplies glyph metrics incrementally, after the face */ + /* object has been created */ + /* */ + /* */ + /* object :: a pointer to the user's data, specified by the 'object' */ + /* field in FT_Incremental_Interface */ + /* */ + /* index :: the glyph index */ + /* */ + /* vertical :: true for vertical layout, false for horizontal layout */ + /* */ + /* */ + /* metrics :: the glyph metrics in font units */ + /* */ + /* */ + /* a standard error code */ + /* */ + typedef FT_Error (*FT_Get_Glyph_Metrics_Func)(void* object,FT_UInt index,FT_Bool vertical, + FT_Basic_Glyph_Metrics* metrics,FT_Bool* found); + + + /*************************************************************************/ + /* */ + /* */ + /* FT_Incremental_Interface_Funcs */ + /* */ + /* */ + /* A table of functions for accessing fonts that load data */ + /* incrementally. Used in FT_Incremental_Interface */ + /* */ + /* */ + /* get_glyph_data :: The function to get glyph data. Must not be */ + /* null. */ + /* */ + /* get_glyph_metrics :: The function to get glyph metrics. May be */ + /* null if the font does not provide */ + /* overriding glyph metrics. */ + /* */ + typedef struct FT_Incremental_Interface_Funcs_ + { + FT_Get_Glyph_Data_Func get_glyph_data; + FT_Get_Glyph_Metrics_Func get_glyph_metrics; + } FT_Incremental_Interface_Funcs; + + + /*************************************************************************/ + /* */ + /* */ + /* FT_Incremental_Interface */ + /* */ + /* */ + /* This interface structure is provided to FT_Open_Face to allow */ + /* incremental faces to be opened. */ + /* */ + /* A incremental face supplies no glyph data when it is opened. */ + /* Instead the glyph data is supplied using a callback function. */ + /* Optionally, metrics that override the metrics in the typeface */ + /* data can also be supplied using another callback function. */ + /* */ + /* */ + /* funcs :: The table of functions */ + /* */ + /* object :: The pointer passed to the functions. Usually it */ + /* points to the object from which glyph and metric */ + /* data is obtained. */ + /* */ + typedef struct FT_Incremental_Interface_ + { + const FT_Incremental_Interface_Funcs* funcs; + void* object; + } FT_Incremental_Interface; + /*************************************************************************/ /*************************************************************************/ diff --git a/include/freetype/fttypes.h b/include/freetype/fttypes.h index 7fe477706..c46bbd550 100644 --- a/include/freetype/fttypes.h +++ b/include/freetype/fttypes.h @@ -357,6 +357,26 @@ FT_BEGIN_HEADER } FT_Matrix; + /*************************************************************************/ + /* */ + /* */ + /* FT_Data */ + /* */ + /* */ + /* Read-only binary data represented as a pointer and a length. */ + /* */ + /* */ + /* pointer :: The data. */ + /* */ + /* length :: The length of the data in bytes. */ + /* */ + typedef struct FT_Data_ + { + const FT_Byte* pointer; + FT_Int length; + } FT_Data; + + /*************************************************************************/ /* */ /* */