shithub: freetype+ttf2subf

Download patch

ref: 35222ff7bb7000298af514e7693af5f1ff1c8417
parent: e0decd1e2783cae2645f2308268235690d58090a
author: Wu, Chia-I (吳佳一) <[email protected]>
date: Tue Feb 14 02:25:57 EST 2006

Clean up the SFNT_Interface.  In this final pass, `load_hmtx' is
splitted from `load_hhea'.

* include/freetype/internal/sfnt.h, src/sfnt/sfdriver.c,
src/sfnt/ttmtx.c, src/sfnt/ttmtx.h: Split `hmtx' from `hhea'.

* src/sfnt/sfobjs.c (sfnt_load_face): Update.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2006-02-13  Chia-I Wu  <[email protected]>
 
+	Clean up the SFNT_Interface.  In this final pass, `load_hmtx' is
+	splitted from `load_hhea'.
+
+	* include/freetype/internal/sfnt.h, src/sfnt/sfdriver.c,
+	src/sfnt/ttmtx.c, src/sfnt/ttmtx.h: Split `hmtx' from `hhea'.
+
+	* src/sfnt/sfobjs.c (sfnt_load_face): Update.
+
+2006-02-13  Chia-I Wu  <[email protected]>
+
 	* src/sfnt/ttmtx.h, src/sfnt/ttmtx.c: Why are there two copies of
 	code...
 
--- a/include/freetype/internal/sfnt.h
+++ b/include/freetype/internal/sfnt.h
@@ -512,6 +512,7 @@
     /* be called from external modules, if there is a need to do so */
     TT_Load_Table_Func           load_head;
     TT_Load_Metrics_Func         load_hhea;
+    TT_Load_Metrics_Func         load_hmtx;
     TT_Load_Table_Func           load_cmap;
     TT_Load_Table_Func           load_maxp;
     TT_Load_Table_Func           load_os2;
--- a/src/sfnt/sfdriver.c
+++ b/src/sfnt/sfdriver.c
@@ -390,6 +390,7 @@
 
     tt_face_load_head,
     tt_face_load_hhea,
+    tt_face_load_hmtx,
     tt_face_load_cmap,
     tt_face_load_maxp,
     tt_face_load_os2,
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -561,12 +561,14 @@
     if ( !is_apple_sbit )
     {
       /* load the `hhea' and `hmtx' tables at once */
-      error = sfnt->load_hhea( face, stream, 0 );
+      error = sfnt->load_hhea( face, stream, 0 ) ||
+              sfnt->load_hmtx( face, stream, 0 );
       if ( error )
         goto Exit;
 
       /* try to load the `vhea' and `vmtx' tables at once */
-      error = sfnt->load_hhea( face, stream, 1 );
+      error = sfnt->load_hhea( face, stream, 1 ) ||
+              sfnt->load_hmtx( face, stream, 1 );
       if ( error )
         goto Exit;
 
--- a/src/sfnt/ttmtx.c
+++ b/src/sfnt/ttmtx.c
@@ -55,7 +55,7 @@
   /*                                                                       */
 #ifdef FT_OPTIMIZE_MEMORY
 
-  static FT_Error
+  FT_LOCAL_DEF( FT_Error )
   tt_face_load_hmtx( TT_Face    face,
                      FT_Stream  stream,
                      FT_Bool    vertical )
@@ -130,7 +130,7 @@
 
 #else /* !OPTIMIZE_MEMORY */
 
-  static FT_Error
+  FT_LOCAL_DEF( FT_Error )
   tt_face_load_hmtx( TT_Face    face,
                      FT_Stream  stream,
                      FT_Bool    vertical )
@@ -378,9 +378,7 @@
 
     FT_TRACE2(( "loaded\n" ));
 
-    /* Now try to load the corresponding metrics */
-
-    error = tt_face_load_hmtx( face, stream, vertical );
+    return SFNT_Err_Ok;
 
   Exit:
     return error;
--- a/src/sfnt/ttmtx.h
+++ b/src/sfnt/ttmtx.h
@@ -35,6 +35,12 @@
 
 
   FT_LOCAL( FT_Error )
+  tt_face_load_hmtx( TT_Face    face,
+                     FT_Stream  stream,
+                     FT_Bool    vertical );
+
+
+  FT_LOCAL( FT_Error )
   tt_face_get_metrics( TT_Face     face,
                        FT_Bool     vertical,
                        FT_UInt     gindex,