Commit 9a9edc662481a675dfd05455e88c259b0fe8168f

David Turner 2001-12-22T16:07:52

fixing the autohinter: the advance of auto-hinted glyphs in mono-spaced fonts was incorrect

diff --git a/ChangeLog b/ChangeLog
index 6c49c9a..d8c5c63 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,16 @@
+2001-12-22  David Turner  <david@freetype.org>
+
+	* src/autohint/ahhint.c (ah_hinter_load): auto-hinted glyphs had an
+  incorrect glyph advance in the case of mono-width fonts (like Courier,
+  Andale Mono, etc..)
+
+
 2001-12-22  Detlef Würkner  <TetiSoft@apg.lahn.de>
 
 	* builds/amiga/*: Adaptations to latest changes.
 	Support added for MorphOS.
 
+
 2001-12-22  Werner Lemberg  <wl@gnu.org>
 
 	* src/pshinter/pshrec.c (FT_COMPONENT): Redefine to `trace_pshrec'.
@@ -17,6 +25,7 @@
 
 	* docs/modules.txt: New file.
 
+
 2001-12-21  David Turner  <david@freetype.org>
 
 	* src/pshinter/pshrec.c (ps_hints_t2mask, ps_hints_t2counter):
@@ -30,9 +39,29 @@
 	(T1_Decoder_Parse_Charstrings), src/pshinter/pshalgo2.c (*), Fixed a
 	bug where the X and Y axis where inversed in the postscript hinter. 
 	This caused problem when displaying on non-square surfaces.
-
+>>>>>>> 1.289
+
+<<<<<<< ChangeLog
+        * src/cff/cffgload.c: added a comment regarding "cntrmask" operator
+        
+        * src/pshinter/pshrec.c: now ignores invalid "hintmask" and "cntrmask"
+        operators (instead of returning an error). Glyph 2028 of the CFF font
+        "MSung-Light-Acro" couldn't be rendered otherwise (it seems its
+        charstring is buggy, though this requires more analysis)..
+
+        * src/cff/cffgload.c, src/psaux/t1decode.c, src/pshinter/pshrec.c,
+        src/pshinter/ahalgo2.c, src/pshinter/pshglob.h: fixed a bug where
+        the X and Y axis where inversed in the postscript hinter. this
+        caused problem when displaying on non-square surfaces..
+
+        * include/freetype/cache/ftcmanag.h, include/freetype/cache/ftcimage.h,
+        include/freetype/cache/ftcsbits.h: updating documentation to better
+        explain the use of the "anode" output parameter in lookup functions
+
+=======
 	* src/pshinter/pshalgo2.c: s/vertical/dimension/.
 
+>>>>>>> 1.289
 	* src/pshinter/pshglob.c (psh_globals_new): Replaced a floating
 	point constant with a fixed-float equivalent.  For some reasons not
 	all compilers are capable of directly computing a floating pointer
diff --git a/README b/README
index b032efc..a2d44e1 100644
--- a/README
+++ b/README
@@ -1,4 +1,12 @@
 
+  Special note to Unix users !!
+  =============================
+
+  Please read the file "README.UNX", it contains important information
+  regarding the installation of FreeType on Unix systems, especially
+  Linux ones !!
+
+
   FreeType 2.0.6
   ==============
 
diff --git a/src/autohint/ahhint.c b/src/autohint/ahhint.c
index aba2297..22c66e1 100644
--- a/src/autohint/ahhint.c
+++ b/src/autohint/ahhint.c
@@ -1290,8 +1290,15 @@
       slot->metrics.height       = bbox.yMax - bbox.yMin;
       slot->metrics.horiBearingX = bbox.xMin;
       slot->metrics.horiBearingY = bbox.yMax;
-      slot->metrics.horiAdvance  = hinter->pp2.x - hinter->pp1.x;
-      /* XXX: TO DO - slot->linearHoriAdvance */
+
+      /* for mono-width fonts (like Andale, Courier, etc..), we need */
+      /* to keep the original rounded advance..                     */
+      if ( !FT_IS_FIXED_WIDTH( slot->face ) )
+        slot->metrics.horiAdvance  = hinter->pp2.x - hinter->pp1.x;
+      else
+        slot->metrics.horiAdvance = FT_MulFix( slot->metrics.horiAdvance, x_scale );
+
+      slot->metrics.horiAdvance = (slot->metrics.horiAdvance+32) & -64;
 
       /* now copy outline into glyph slot */
       ah_loader_rewind( slot->internal->loader );