shithub: freetype+ttf2subf

Download patch

ref: eee7d8baa156f8488e1351b84bb2f8ebf20fec82
parent: 0aa36160d6ca5b4f7280127ea861a637759a1ff6
author: Werner Lemberg <[email protected]>
date: Tue Mar 10 07:15:15 EDT 2015

[base] Rename `FT_Bitmap_New' to `FT_Bitmap_Init'.

* include/ftbitmap.h, src/base/ftbitmap.c: Implement it.
Update all callers.

* docs/CHANGES: Updated.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2015-03-10  Werner Lemberg  <[email protected]>
+
+	[base] Rename `FT_Bitmap_New' to `FT_Bitmap_Init'.
+
+	* include/ftbitmap.h, src/base/ftbitmap.c: Implement it.
+	Update all callers.
+
+	* docs/CHANGES: Updated.
+
 2015-03-06  Werner Lemberg  <[email protected]>
 
 	* src/sfnt/ttload.c (tt_face_load_font_dir): Fix compiler warning.
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -21,7 +21,9 @@
       need the lock  to be held as  long as the same  `FT_Face' is not
       used from multiple threads at the same time.
 
+    - Thai script support has been added to the auto-hinter.
 
+
   III. MISCELLANEOUS
 
     - Some  fields  in  the  `FTC_ImageTypeRec'  structure  have  been
@@ -31,6 +33,10 @@
 
       This  change doesn't  break  the ABI;  however,  it might  cause
       compiler warnings.
+
+    - Function `FT_Bitmap_New'  has been renamed to  `FT_Bitmap_Init',
+      since this  name better  reflects its  function.   For backwards
+      compatibility, the old function name is still available.
 
 
 ======================================================================
--- a/include/ftbitmap.h
+++ b/include/ftbitmap.h
@@ -55,7 +55,7 @@
   /*************************************************************************/
   /*                                                                       */
   /* <Function>                                                            */
-  /*    FT_Bitmap_New                                                      */
+  /*    FT_Bitmap_Init                                                     */
   /*                                                                       */
   /* <Description>                                                         */
   /*    Initialize a pointer to an @FT_Bitmap structure.                   */
@@ -63,7 +63,15 @@
   /* <InOut>                                                               */
   /*    abitmap :: A pointer to the bitmap structure.                      */
   /*                                                                       */
+  /* <Note>                                                                */
+  /*    A deprecated name for the same function is `FT_Bitmap_New'.        */
+  /*                                                                       */
   FT_EXPORT( void )
+  FT_Bitmap_Init( FT_Bitmap  *abitmap );
+
+
+  /* deprecated */
+  FT_EXPORT( void )
   FT_Bitmap_New( FT_Bitmap  *abitmap );
 
 
@@ -202,7 +210,7 @@
   /*    FT_Bitmap_Done                                                     */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    Destroy a bitmap object created with @FT_Bitmap_New.               */
+  /*    Destroy a bitmap object initialized with @FT_Bitmap_Init.          */
   /*                                                                       */
   /* <Input>                                                               */
   /*    library :: A handle to a library object.                           */
--- a/src/base/ftbitmap.c
+++ b/src/base/ftbitmap.c
@@ -31,6 +31,16 @@
   /* documentation is in ftbitmap.h */
 
   FT_EXPORT_DEF( void )
+  FT_Bitmap_Init( FT_Bitmap  *abitmap )
+  {
+    if ( abitmap )
+      *abitmap = null_bitmap;
+  }
+
+
+  /* deprecated function name; retained for ABI compatibility */
+
+  FT_EXPORT_DEF( void )
   FT_Bitmap_New( FT_Bitmap  *abitmap )
   {
     if ( abitmap )
@@ -297,7 +307,7 @@
 
 
         /* convert to 8bpp */
-        FT_Bitmap_New( &tmp );
+        FT_Bitmap_Init( &tmp );
         error = FT_Bitmap_Convert( library, bitmap, &tmp, 1 );
         if ( error )
           return error;
@@ -759,7 +769,7 @@
       FT_Error   error;
 
 
-      FT_Bitmap_New( &bitmap );
+      FT_Bitmap_Init( &bitmap );
       error = FT_Bitmap_Copy( slot->library, &slot->bitmap, &bitmap );
       if ( error )
         return error;
--- a/src/base/ftglyph.c
+++ b/src/base/ftglyph.c
@@ -82,7 +82,7 @@
     }
     else
     {
-      FT_Bitmap_New( &glyph->bitmap );
+      FT_Bitmap_Init( &glyph->bitmap );
       error = FT_Bitmap_Copy( library, &slot->bitmap, &glyph->bitmap );
     }
 
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -4123,7 +4123,7 @@
       FT_Error   err;
 
 
-      FT_Bitmap_New( &bitmap );
+      FT_Bitmap_Init( &bitmap );
 
       /* this also converts the bitmap flow to `down' (i.e., pitch > 0) */
       err = FT_Bitmap_Convert( library, &slot->bitmap, &bitmap, 1 );
--- a/src/sfnt/ttsbit.c
+++ b/src/sfnt/ttsbit.c
@@ -1448,7 +1448,7 @@
       FT_Library  library = face->root.glyph->library;
 
 
-      FT_Bitmap_New( &new_map );
+      FT_Bitmap_Init( &new_map );
 
       /* Convert to 8bit grayscale. */
       error = FT_Bitmap_Convert( library, map, &new_map, 1 );