shithub: freetype+ttf2subf

Download patch

ref: 8d81d41ae3373c830cf8a41f0da430fb0608c4a6
parent: cb18238109b850c947c851b8a504c2815f81a67f
author: Suzuki, Toshiya (鈴木俊哉) <[email protected]>
date: Fri Nov 18 02:47:06 EST 2005

add FT_TrueTypeGX_Free() etc to free the buffers allocated by gxvalid, otvalid

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2005-11-18  susuzki toshiya  <[email protected]>
+
+	* 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  <[email protected]>
 
 	* builds/unix/ftsystem.c (FT_Stream_Open, FT_New_Memory,
--- a/include/freetype/ftgxval.h
+++ b/include/freetype/ftgxval.h
@@ -206,10 +206,10 @@
   *   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 @@
 
  /**********************************************************************
   *
+  * @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,13 +310,40 @@
   *
   * @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,
                            FT_UInt    validation_flags,
                            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 );
 
 
  /* */
--- a/include/freetype/ftotval.h
+++ b/include/freetype/ftotval.h
@@ -146,9 +146,10 @@
   *   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,
@@ -158,6 +159,33 @@
                         FT_Bytes  *GPOS_table, 
                         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 );
+
 
  /* */
 
--- 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,
@@ -101,6 +112,17 @@
 
   Exit:
     return error;
+  }
+
+
+  FT_EXPORT_DEF( void )
+  FT_ClassicKern_Free( FT_Face   face,
+                       FT_Bytes  table )
+  {
+    FT_Memory  memory = FT_FACE_MEMORY( face );
+
+
+    FT_FREE( table );
   }
 
 
--- 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 */