add FT_TrueTypeGX_Free() etc to free the buffers allocated by gxvalid, otvalid
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 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
diff --git a/ChangeLog b/ChangeLog
index d29c1f0..b4fdf8a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2005-11-18 susuzki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+
+ * include/freetype/ftgxval.h, src/base/ftgxval.c
+ (FT_TrueTypeGX_Free, FT_ClassicKern_Free): New functions to free
+ buffers allocated by gxvalid module.
+ * include/freetype/ftotval.h, src/base/ftotval.c
+ (FT_OpenType_Free): New function to free buffer allocated by
+ otvalid module.
+
2005-11-18 Chia-I Wu <b90201047@ntu.edu.tw>
* builds/unix/ftsystem.c (FT_Stream_Open, FT_New_Memory,
diff --git a/include/freetype/ftgxval.h b/include/freetype/ftgxval.h
index b78d7f3..fd999cc 100644
--- a/include/freetype/ftgxval.h
+++ b/include/freetype/ftgxval.h
@@ -206,10 +206,10 @@ FT_BEGIN_HEADER
* otherwise.
*
* After use, the application should deallocate the buffers pointed to by
- * each tables' element. A NULL value indicates that the table either
- * doesn't exist in the font, the application hasn't asked for
- * validation, or the validator doesn't have the ability to validate the
- * sfnt table.
+ * each tables' element, by calling FT_TrueTypeGX_Free(). A NULL value
+ * indicates that the table either doesn't exist in the font,
+ * the application hasn't asked for validation, or the validator doesn't
+ * have the ability to validate the sfnt table.
*/
FT_EXPORT( FT_Error )
FT_TrueTypeGX_Validate( FT_Face face,
@@ -222,6 +222,33 @@ FT_BEGIN_HEADER
/**********************************************************************
*
+ * @function:
+ * FT_TrueTypeGX_Free
+ *
+ * @description:
+ * Free the buffer allocated by TrueTypeGX validator.
+ *
+ * @input:
+ * face ::
+ * A handle to the input face.
+ *
+ * table ::
+ * The pointer to the buffer allocated by
+ * FT_TrueTypeGX_Validate().
+ *
+ * @note:
+ * This function must be used to free the buffer allocated by
+ * FT_TrueTypeGX_Validate() only.
+ */
+ FT_EXPORT( void )
+ FT_TrueTypeGX_Free( FT_Face face,
+ FT_Bytes table );
+
+
+ /* */
+
+ /**********************************************************************
+ *
* @enum:
* FT_VALIDATE_CKERNXXX
*
@@ -283,8 +310,8 @@ FT_BEGIN_HEADER
*
* @note:
* After use, the application should deallocate the buffers pointed to by
- * ckern_table. A NULL value indicates that the table doesn't exist in
- * the font.
+ * ckern_table, by calling FT_ClassicKern_Free(). A NULL value indicates
+ * that the table doesn't exist in the font.
*/
FT_EXPORT( FT_Error )
FT_ClassicKern_Validate( FT_Face face,
@@ -292,6 +319,33 @@ FT_BEGIN_HEADER
FT_Bytes *ckern_table );
+ /* */
+
+ /**********************************************************************
+ *
+ * @function:
+ * FT_ClassicKern_Free
+ *
+ * @description:
+ * Free the buffer allocated by classic Kern validator.
+ *
+ * @input:
+ * face ::
+ * A handle to the input face.
+ *
+ * table ::
+ * The pointer to the buffer that is allocated by
+ * FT_ClassicKern_Validate().
+ *
+ * @note:
+ * This function must be used to free the buffer allocated by
+ * FT_ClassicKern_Validate() only.
+ */
+ FT_EXPORT( void )
+ FT_ClassicKern_Free( FT_Face face,
+ FT_Bytes table );
+
+
/* */
diff --git a/include/freetype/ftotval.h b/include/freetype/ftotval.h
index fc3306c..d9b92c1 100644
--- a/include/freetype/ftotval.h
+++ b/include/freetype/ftotval.h
@@ -146,9 +146,10 @@ FT_BEGIN_HEADER
* This function only works with OpenType fonts, returning an error
* otherwise.
*
- * After use, the application should deallocate the five tables with
- * `free'. A NULL value indicates that the table either doesn't exist
- * in the font, or the application hasn't asked for validation.
+ * After use, the application should deallocate the five tables by
+ * FT_OpenType_Free(). A NULL value indicates that the table either
+ * doesn't exist in the font, or the application hasn't asked for
+ * validation.
*/
FT_EXPORT( FT_Error )
FT_OpenType_Validate( FT_Face face,
@@ -159,6 +160,33 @@ FT_BEGIN_HEADER
FT_Bytes *GSUB_table,
FT_Bytes *JSTF_table );
+ /* */
+
+ /**********************************************************************
+ *
+ * @function:
+ * FT_OpenType_Free
+ *
+ * @description:
+ * Free the buffer allocated by OpenType validator.
+ *
+ * @input:
+ * face ::
+ * A handle to the input face.
+ *
+ * table ::
+ * The pointer to the buffer that is allocated by
+ * FT_OpenType_Validate().
+ *
+ * @note:
+ * This function must be used to free the buffer allocated by
+ * FT_OpenType_Validate() only.
+ */
+ FT_EXPORT( void )
+ FT_OpenType_Free( FT_Face face,
+ FT_Bytes table );
+
+
/* */
diff --git a/src/base/ftgxval.c b/src/base/ftgxval.c
index 10ee969..615e5ed 100644
--- a/src/base/ftgxval.c
+++ b/src/base/ftgxval.c
@@ -69,6 +69,17 @@
}
+ FT_EXPORT_DEF( void )
+ FT_TrueTypeGX_Free( FT_Face face,
+ FT_Bytes table )
+ {
+ FT_Memory memory = FT_FACE_MEMORY( face );
+
+
+ FT_FREE( table );
+ }
+
+
FT_EXPORT_DEF( FT_Error )
FT_ClassicKern_Validate( FT_Face face,
FT_UInt validation_flags,
@@ -104,4 +115,15 @@
}
+ FT_EXPORT_DEF( void )
+ FT_ClassicKern_Free( FT_Face face,
+ FT_Bytes table )
+ {
+ FT_Memory memory = FT_FACE_MEMORY( face );
+
+
+ FT_FREE( table );
+ }
+
+
/* END */
diff --git a/src/base/ftotval.c b/src/base/ftotval.c
index 1364d75..f14580d 100644
--- a/src/base/ftotval.c
+++ b/src/base/ftotval.c
@@ -69,4 +69,15 @@
}
+ FT_EXPORT_DEF( void )
+ FT_OpenType_Free( FT_Face face,
+ FT_Bytes table )
+ {
+ FT_Memory memory = FT_FACE_MEMORY( face );
+
+
+ FT_FREE( table );
+ }
+
+
/* END */