? pango/opentype/ftglue.c
? pango/opentype/ftglue.h
Index: pango/opentype/Makefile.am
===================================================================
RCS file: /cvs/gnome/pango/pango/opentype/Makefile.am,v
retrieving revision 1.15
diff -u -p -r1.15 Makefile.am
--- pango/opentype/Makefile.am	12 Apr 2005 01:27:21 -0000	1.15
+++ pango/opentype/Makefile.am	22 Jul 2005 03:23:31 -0000
@@ -16,6 +16,8 @@ noinst_LTLIBRARIES = libpango-ot.la
 
 libpango_ot_la_SOURCES =  	\
 	fterrcompat.h		\
+	ftglue.h		\
+	ftglue.c		\
 	ftxopen.c	 	\
 	ftxopen.h	 	\
 	ftxopenf.h	 	\
Index: pango/opentype/fterrcompat.h
===================================================================
RCS file: /cvs/gnome/pango/pango/opentype/fterrcompat.h,v
retrieving revision 1.6
diff -u -p -r1.6 fterrcompat.h
--- pango/opentype/fterrcompat.h	21 Jul 2005 18:15:36 -0000	1.6
+++ pango/opentype/fterrcompat.h	22 Jul 2005 03:23:31 -0000
@@ -1,95 +1 @@
-/* Pango
- * fterrcompat.h: Compat defines for compiling with newer versions
- *                of FreeType
- *
- * Copyright © 2003 Red Hat, Inc
- *
- * The code is dual-licensed under the GNU Public License and the
- * FreeType license. See see FT-license.txt for full details.
- */
-#ifndef FTERRCOMPAT_H
-#define FTERRCOMPAT_H
-
-#include <config.h>
-
-#define TT_Err_Ok FT_Err_Ok
-#define TT_Err_Invalid_Argument FT_Err_Invalid_Argument
-#define TT_Err_Invalid_Face_Handle FT_Err_Invalid_Face_Handle
-#define TT_Err_Table_Missing FT_Err_Table_Missing
-
-/* Compat macros for name changes in FreeType 2.1.0
- */
-#if (FREETYPE_MAJOR == 2) && (FREETYPE_MINOR >= 1)
-
-#define FILE_Pos()             FT_STREAM_POS()
-#define FILE_Seek( position ) FT_STREAM_SEEK( position)
-
-#define ACCESS_Frame( size ) FT_FRAME_ENTER( size )
-#define FORGET_Frame() FT_FRAME_EXIT()
-
-#define GET_Char()      FT_GET_CHAR()
-#define GET_Byte()      FT_GET_BYTE()
-#define GET_Short()     FT_GET_SHORT()
-#define GET_UShort()    FT_GET_USHORT()
-#define GET_Offset()    FT_GET_OFF3()
-#define GET_UOffset()   FT_GET_UOFF3()
-#define GET_Long()      FT_GET_LONG()
-#define GET_ULong()     FT_GET_ULONG()
-#define GET_Tag4()      FT_GET_TAG4()
-
-/* Macro definitions to avoid bogus warnings about strict
- * aliasing. These make code generation worse, so we only
- * use them when necessary
- */
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
-#define ALLOC_ARRAY( _pointer_, _count_, _type_ ) ({		\
-  int result;							\
-  void *_tmp_;							\
-  result = FT_SET_ERROR ( FT_MEM_ALLOC_ARRAY ( _tmp_,		\
-                                               _count_,		\
-                                               _type_ ) );	\
-  _pointer_ = _tmp_;						\
-  result;							\
-})
-
-/* FT_MEM_REALLOC macro broken in 2.1.0 */
-#define REALLOC_ARRAY( _pointer_, _old_, _new_, _type_ ) ({	\
-  int result;							\
-  void *_tmp_ = _pointer_;					\
-  result = FT_SET_ERROR ( FT_MEM_REALLOC( _tmp_,		\
-			 (_old_) * sizeof ( _type_ ),		\
-	                 (_new_) * sizeof ( _type_ ) ) );	\
-  _pointer_ = _tmp_;						\
-  result;							\
-})
- 
-#define FREE( _pointer_ ) ({			\
-  void *_tmp_ = _pointer_;			\
-  FT_FREE ( _tmp_ );				\
-  _pointer_ = _tmp_;				\
-})
-#define ALLOC( _pointer_, _size_ ) ({		\
-  int result;					\
-  void *_tmp_;					\
-  result = FT_ALLOC( _tmp_, _size_ );		\
-  _pointer_ = _tmp_;				\
-  result; 					\
-})
-#else
-#define ALLOC_ARRAY( _pointer_, _count_, _type_ ) \
-  FT_SET_ERROR (FT_MEM_ALLOC_ARRAY( _pointer_, _count_, _type_))
-
-/* FT_MEM_REALLOC macro broken in 2.1.0 */
-#define REALLOC_ARRAY( _pointer_, _old_, _new_, _type_ ) \
-  FT_SET_ERROR ( FT_MEM_REALLOC( _pointer_, (_old_) * sizeof ( _type_ ),   \
-		(_new_) * sizeof ( _type_ ) ) )
-
-#define FREE( _pointer_ )          FT_FREE( _pointer_ )
-#define ALLOC( _pointer_, _size_ ) FT_ALLOC( _pointer_, _size_ )
-#endif /* gcc >= 3.3 */
-
-#define MEM_Copy( dest, source, count ) FT_MEM_COPY( dest, source, count )
-
-#endif /* freetype >= 2.1.0 */
-
-#endif /* FTERRCOMPAT_H */
+#include "ftglue.h"
Index: pango/opentype/ftxgdef.c
===================================================================
RCS file: /cvs/gnome/pango/pango/opentype/ftxgdef.c,v
retrieving revision 1.16
diff -u -p -r1.16 ftxgdef.c
--- pango/opentype/ftxgdef.c	3 Mar 2005 19:38:02 -0000	1.16
+++ pango/opentype/ftxgdef.c	22 Jul 2005 03:23:31 -0000
@@ -22,10 +22,6 @@
 
 #include FT_TRUETYPE_TAGS_H
 
-#include FT_INTERNAL_STREAM_H
-#include FT_INTERNAL_MEMORY_H
-#include FT_INTERNAL_TRUETYPE_TYPES_H
-
 #define TTAG_GDEF  FT_MAKE_TAG( 'G', 'D', 'E', 'F' )
 
   static FT_Error  Load_AttachList( TTO_AttachList*  al,
@@ -170,7 +166,6 @@
     FT_Error         error;
     FT_Memory        memory = face->memory;
     FT_Stream        stream = face->stream;
-    TT_Face          tt_face = (TT_Face)face;
     FT_ULong         cur_offset, new_offset, base_offset;
 
     TTO_GDEFHeader*  gdef;
@@ -179,7 +174,7 @@
     if ( !retptr )
       return TT_Err_Invalid_Argument;
 
-    if (( error = tt_face->goto_table( tt_face, TTAG_GDEF, stream, NULL ) ))
+    if (( error = ftglue_face_goto_table( face, TTAG_GDEF, stream ) ))
       return error;
 
     if (( error = TT_New_GDEF_Table ( face, &gdef ) ))
Index: pango/opentype/ftxgpos.c
===================================================================
RCS file: /cvs/gnome/pango/pango/opentype/ftxgpos.c,v
retrieving revision 1.26
diff -u -p -r1.26 ftxgpos.c
--- pango/opentype/ftxgpos.c	22 Sep 2004 18:14:55 -0000	1.26
+++ pango/opentype/ftxgpos.c	22 Jul 2005 03:23:31 -0000
@@ -28,10 +28,6 @@
 
 #include FT_TRUETYPE_TAGS_H
 
-#include FT_INTERNAL_STREAM_H
-#include FT_INTERNAL_MEMORY_H
-#include FT_INTERNAL_TRUETYPE_TYPES_H
-
 #define TTAG_GPOS  FT_MAKE_TAG( 'G', 'P', 'O', 'S' )
 
   struct  GPOS_Instance_
@@ -89,7 +85,6 @@
     FT_UShort        i, num_lookups;
     TTO_GPOSHeader*  gpos;
     TTO_Lookup*      lo;
-    TT_Face          tt_face = (TT_Face)face;
 
     FT_Stream  stream = face->stream;
     FT_Error   error;
@@ -102,7 +97,7 @@
     if ( !stream )
       return TT_Err_Invalid_Face_Handle;
 
-    if (( error = tt_face->goto_table( tt_face, TTAG_GPOS, stream, NULL ) ))
+    if (( error = ftglue_face_goto_table( face, TTAG_GPOS, stream ) ))
       return error;
 
     base_offset = FILE_Pos();
Index: pango/opentype/ftxgsub.c
===================================================================
RCS file: /cvs/gnome/pango/pango/opentype/ftxgsub.c,v
retrieving revision 1.27
diff -u -p -r1.27 ftxgsub.c
--- pango/opentype/ftxgsub.c	22 Sep 2004 18:14:55 -0000	1.27
+++ pango/opentype/ftxgsub.c	22 Jul 2005 03:23:31 -0000
@@ -30,11 +30,6 @@
 
 #include FT_TRUETYPE_TAGS_H
 
-#include FT_INTERNAL_STREAM_H
-#include FT_INTERNAL_MEMORY_H
-#include FT_INTERNAL_TRUETYPE_TYPES_H
-
-
 #define GSUB_ID  Build_Extension_ID( 'G', 'S', 'U', 'B' )
 
 
@@ -81,7 +76,6 @@
     FT_Memory        memory = face->memory;
     FT_Error         error;
     FT_ULong         cur_offset, new_offset, base_offset;
-    TT_Face          tt_face = (TT_Face)face;
 
     FT_UShort        i, num_lookups;
     TTO_GSUBHeader*  gsub;
@@ -90,7 +84,7 @@
     if ( !retptr )
       return TT_Err_Invalid_Argument;
 
-    if (( error = tt_face->goto_table( tt_face, TTAG_GSUB, stream, NULL ) ))
+    if (( error = ftglue_face_goto_table( face, TTAG_GSUB, stream ) ))
       return error;
 
     base_offset = FILE_Pos();
Index: pango/opentype/ftxopen.c
===================================================================
RCS file: /cvs/gnome/pango/pango/opentype/ftxopen.c,v
retrieving revision 1.14
diff -u -p -r1.14 ftxopen.c
--- pango/opentype/ftxopen.c	3 Mar 2005 19:38:02 -0000	1.14
+++ pango/opentype/ftxopen.c	22 Jul 2005 03:23:31 -0000
@@ -20,10 +20,6 @@
 
 #include "fterrcompat.h"
 
-#include FT_INTERNAL_STREAM_H
-#include FT_INTERNAL_MEMORY_H
-#include FT_INTERNAL_TRUETYPE_TYPES_H
-
 
   /***************************
    * Script related functions
@@ -429,6 +425,7 @@
         Free_Feature( &fr[n].Feature, memory );
 
       FREE( fr );
+      FREE( fl->ApplyOrder );
     }
   }
 
Index: pango/opentype/otlbuffer.c
===================================================================
RCS file: /cvs/gnome/pango/pango/opentype/otlbuffer.c,v
retrieving revision 1.6
diff -u -p -r1.6 otlbuffer.c
--- pango/opentype/otlbuffer.c	27 Jul 2004 10:43:58 -0000	1.6
+++ pango/opentype/otlbuffer.c	22 Jul 2005 03:23:31 -0000
@@ -13,8 +13,6 @@
  */
 #include <otlbuffer.h>
 
-#include FT_INTERNAL_MEMORY_H
-
 /* To get the gcc-3.3 strict-aliasing compatible versions
  * FREE/REALLOC_ARRAY/etc. rather than the FT_* versions
  * that
Index: pango/opentype/pango-ot-info.c
===================================================================
RCS file: /cvs/gnome/pango/pango/opentype/pango-ot-info.c,v
retrieving revision 1.12
diff -u -p -r1.12 pango-ot-info.c
--- pango/opentype/pango-ot-info.c	14 Jun 2005 19:54:18 -0000	1.12
+++ pango/opentype/pango-ot-info.c	22 Jul 2005 03:23:31 -0000
@@ -21,7 +21,6 @@
 
 #include "pango-ot-private.h"
 #include "fterrcompat.h"
-#include FT_INTERNAL_OBJECTS_H
 #include FT_MODULE_H
 
 static void pango_ot_info_class_init (GObjectClass *object_class);
@@ -139,8 +138,7 @@ pango_ot_info_get (FT_Face face)
 static gboolean
 is_truetype (FT_Face face)
 {
-  return strcmp (FT_MODULE_CLASS (face->driver)->module_name, "truetype") == 0 ||
-	 strcmp (FT_MODULE_CLASS (face->driver)->module_name, "cff") == 0;
+  return FT_IS_SFNT(face);
 }
 
 typedef struct _GlyphInfo GlyphInfo;
Index: pango/opentype/pango-ot-ruleset.c
===================================================================
RCS file: /cvs/gnome/pango/pango/opentype/pango-ot-ruleset.c,v
retrieving revision 1.11
diff -u -p -r1.11 pango-ot-ruleset.c
--- pango/opentype/pango-ot-ruleset.c	14 Jun 2005 19:54:19 -0000	1.11
+++ pango/opentype/pango-ot-ruleset.c	22 Jul 2005 03:23:31 -0000
@@ -22,8 +22,6 @@
 #include <pango/pango-ot.h>
 #include "pango-ot-private.h"
 
-#include FT_INTERNAL_MEMORY_H	/* For FT_Free() */
-
 typedef struct _PangoOTRule PangoOTRule;
 
 struct _PangoOTRule 

