Added types and structures to support incremental typeface loading.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index 18659db..8eb510a 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -202,6 +202,30 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Struct> */
+ /* FT_Basic_Glyph_Metrics */
+ /* */
+ /* <Description> */
+ /* A small glyph metrics structure used to return information */
+ /* for incrementally defined fonts (see FT_Incremental_Interface). */
+ /* */
+ /* <Fields> */
+ /* 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;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
/* FT_Bitmap_Size */
/* */
/* <Description> */
@@ -478,6 +502,111 @@ FT_BEGIN_HEADER
} FT_CharMapRec;
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Get_Glyph_Data_Func */
+ /* */
+ /* <Description> */
+ /* 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 */
+ /* */
+ /* <Input> */
+ /* object :: a pointer to the user's data, specified by the 'object' */
+ /* field in FT_Incremental_Interface */
+ /* */
+ /* index :: the glyph index */
+ /* */
+ /* <Output> */
+ /* data :: the position and length of the data */
+ /* */
+ /* <Return> */
+ /* a standard error code */
+ /* */
+ typedef FT_Error (*FT_Get_Glyph_Data_Func)(void* object,FT_UInt index,FT_Data* data);
+
+
+ /*************************************************************************/
+ /* */
+ /* <Type> */
+ /* FT_Get_Glyph_Metrics_Func */
+ /* */
+ /* <Description> */
+ /* 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 */
+ /* */
+ /* <Input> */
+ /* 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 */
+ /* */
+ /* <Output> */
+ /* metrics :: the glyph metrics in font units */
+ /* */
+ /* <Return> */
+ /* 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);
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Incremental_Interface_Funcs */
+ /* */
+ /* <Description> */
+ /* A table of functions for accessing fonts that load data */
+ /* incrementally. Used in FT_Incremental_Interface */
+ /* */
+ /* <Fields> */
+ /* 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;
+
+
+ /*************************************************************************/
+ /* */
+ /* <Struct> */
+ /* FT_Incremental_Interface */
+ /* */
+ /* <Description> */
+ /* 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. */
+ /* */
+ /* <Fields> */
+ /* 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 7fe4777..c46bbd5 100644
--- a/include/freetype/fttypes.h
+++ b/include/freetype/fttypes.h
@@ -359,6 +359,26 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
+ /* <Struct> */
+ /* FT_Data */
+ /* */
+ /* <Description> */
+ /* Read-only binary data represented as a pointer and a length. */
+ /* */
+ /* <Fields> */
+ /* pointer :: The data. */
+ /* */
+ /* length :: The length of the data in bytes. */
+ /* */
+ typedef struct FT_Data_
+ {
+ const FT_Byte* pointer;
+ FT_Int length;
+ } FT_Data;
+
+
+ /*************************************************************************/
+ /* */
/* <FuncType> */
/* FT_Generic_Finalizer */
/* */