Commit 6c99045972db747535dcd8e4d86afe6e6ce8c7d8

Werner Lemberg 2005-11-18T21:10:59

* src/sfnt/ttload.c (tt_face_load_metrics): Ignore excess number of metrics instead of aborting. Patch suggested by Derek Noonburg. * src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c (cid_slot_load_glyph), src/type1/t1gload.c (T1_Load_Glyph): Scale the glyph properly if no hinter is available. * docs/CHANGES: Mention scaling bug.

diff --git a/ChangeLog b/ChangeLog
index 0269a92..1b18a00 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,12 @@
 	* src/sfnt/ttload.c (tt_face_load_metrics): Ignore excess number
 	of metrics instead of aborting.  Patch suggested by Derek Noonburg.
 
+	* src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c
+	(cid_slot_load_glyph), src/type1/t1gload.c (T1_Load_Glyph): Scale
+	the glyph properly if no hinter is available.
+
+	* docs/CHANGES: Mention scaling bug.
+
 2005-11-18  susuzki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
 	* include/freetype/ftgxval.h, src/base/ftgxval.c
diff --git a/docs/CHANGES b/docs/CHANGES
index 6295ec2..3e4b772 100644
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -9,6 +9,9 @@ LATEST CHANGES BETWEEN 2.2.0 and 2.1.10
     - CFF OpenType  fonts didn't return  correct vertical  metrics for
       glyphs with outlines.
 
+    - If FreeType was compiled without hinters, all font formats based
+      on PS outlines weren't scaled correctly.
+
   II. IMPORTANT CHANGES
 
     - A  new API  `FT_TrueTypeGX_Validate'  (in FT_GX_VALIDATE_H)  has
diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
index d4ea07b..7ac2fcd 100644
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -2667,7 +2667,7 @@
 
 
           /* First of all, scale the points */
-          if ( !hinting )
+          if ( !hinting || !decoder.builder.hints_funcs )
             for ( n = cur->n_points; n > 0; n--, vec++ )
             {
               vec->x = FT_MulFix( vec->x, x_scale );
diff --git a/src/cid/cidgload.c b/src/cid/cidgload.c
index 20cc35c..d61d959 100644
--- a/src/cid/cidgload.c
+++ b/src/cid/cidgload.c
@@ -252,22 +252,6 @@
 #endif /* 0 */
 
 
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-  /**********                                                      *********/
-  /**********                                                      *********/
-  /**********               UNHINTED GLYPH LOADER                  *********/
-  /**********                                                      *********/
-  /**********    The following code is in charge of loading a      *********/
-  /**********    single outline.  It completely ignores hinting    *********/
-  /**********    and is used when FT_LOAD_NO_HINTING is set.       *********/
-  /**********                                                      *********/
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-
-
   FT_LOCAL_DEF( FT_Error )
   cid_slot_load_glyph( FT_GlyphSlot  cidglyph,      /* CID_GlyphSlot */
                        FT_Size       cidsize,       /* CID_Size      */
@@ -394,7 +378,7 @@
 
 
           /* First of all, scale the points */
-          if ( !hinting )
+          if ( !hinting || !decoder.builder.hints_funcs )
             for ( n = cur->n_points; n > 0; n--, vec++ )
             {
               vec->x = FT_MulFix( vec->x, x_scale );
diff --git a/src/type1/t1gload.c b/src/type1/t1gload.c
index b1869f5..54c9b68 100644
--- a/src/type1/t1gload.c
+++ b/src/type1/t1gload.c
@@ -195,23 +195,6 @@
   }
 
 
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-  /**********                                                      *********/
-  /**********               UNHINTED GLYPH LOADER                  *********/
-  /**********                                                      *********/
-  /**********    The following code is in charge of loading a      *********/
-  /**********    single outline.  It completely ignores hinting    *********/
-  /**********    and is used when FT_LOAD_NO_HINTING is set.       *********/
-  /**********                                                      *********/
-  /**********      The Type 1 hinter is located in `t1hint.c'      *********/
-  /**********                                                      *********/
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-
-
   FT_LOCAL_DEF( FT_Error )
   T1_Load_Glyph( T1_GlyphSlot  glyph,
                  T1_Size       size,
@@ -352,7 +335,7 @@
 
 
           /* First of all, scale the points, if we are not hinting */
-          if ( !hinting )
+          if ( !hinting || ! decoder.builder.hints_funcs )
             for ( n = cur->n_points; n > 0; n--, vec++ )
             {
               vec->x = FT_MulFix( vec->x, x_scale );