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.
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
diff --git a/ChangeLog b/ChangeLog
index 6bbe779..bcd15cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2006-02-13 Chia-I Wu <b90201047@ntu.edu.tw>
+ 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 <b90201047@ntu.edu.tw>
+
* src/sfnt/ttmtx.h, src/sfnt/ttmtx.c: Why are there two copies of
code...
diff --git a/include/freetype/internal/sfnt.h b/include/freetype/internal/sfnt.h
index 4d54fb3..e49e023 100644
--- a/include/freetype/internal/sfnt.h
+++ b/include/freetype/internal/sfnt.h
@@ -512,6 +512,7 @@ FT_BEGIN_HEADER
/* 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;
diff --git a/src/sfnt/sfdriver.c b/src/sfnt/sfdriver.c
index f451950..8a8b3e8 100644
--- 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,
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c
index e16cc94..169fba2 100644
--- 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;
diff --git a/src/sfnt/ttmtx.c b/src/sfnt/ttmtx.c
index 86436ed..43a1953 100644
--- 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;
diff --git a/src/sfnt/ttmtx.h b/src/sfnt/ttmtx.h
index 425a616..8b91a11 100644
--- a/src/sfnt/ttmtx.h
+++ b/src/sfnt/ttmtx.h
@@ -35,6 +35,12 @@ FT_BEGIN_HEADER
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,