Commit 048b756389b8e8cd9c60f1d3e4f1d6a575004c3d

Werner Lemberg 2008-04-13T05:55:36

* src/psaux/psconv.c (PS_Conv_ToFixed): Increase precision if integer part is zero.

diff --git a/ChangeLog b/ChangeLog
index 046e615..f1d1f17 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-04-13  Werner Lemberg  <wl@gnu.org>
+
+	* src/psaux/psconv.c (PS_Conv_ToFixed): Increase precision if
+	integer part is zero.
+
 2008-04-01  Werner Lemberg  <wl@gnu.org>
 
 	Fix compilation with g++ 4.1 (with both `single' and `multi'
diff --git a/src/cff/cffdrivr.c b/src/cff/cffdrivr.c
index 3ef0eb5..6c3ff98 100644
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -154,7 +154,7 @@
               FT_UInt       glyph_index,
               FT_Int32      load_flags )
   {
-    FT_Error  error;
+    FT_Error       error;
     CFF_GlyphSlot  slot = (CFF_GlyphSlot)cffslot;
     CFF_Size       size = (CFF_Size)cffsize;
 
@@ -229,8 +229,8 @@
     FT_FREE( gname );
     error = CFF_Err_Ok;
 
-    Exit:
-      return error;
+  Exit:
+    return error;
   }
 
 
diff --git a/src/cff/cffload.c b/src/cff/cffload.c
index 4a75446..1e7dd14 100644
--- a/src/cff/cffload.c
+++ b/src/cff/cffload.c
@@ -31,6 +31,7 @@
 
 
 #if 1
+
   static const FT_UShort  cff_isoadobe_charset[229] =
   {
       0,   1,   2,   3,   4,   5,   6,   7,
@@ -175,13 +176,15 @@
     363, 364, 365, 366, 367, 368, 369, 370,
     371, 372, 373, 374, 375, 376, 377, 378
   };
-#endif
+
+#endif /* 1 */
 
 
   FT_LOCAL_DEF( FT_UShort )
   cff_get_standard_encoding( FT_UInt  charcode )
   {
-    return  (FT_UShort)(charcode < 256 ? cff_standard_encoding[charcode] : 0);
+    return (FT_UShort)( charcode < 256 ? cff_standard_encoding[charcode]
+                                       : 0 );
   }
 
 
diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c
index 56d14c8..4ede97c 100644
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -689,7 +689,7 @@
         if ( pure_cff && cff->top_font.font_dict.cid_registry != 0xFFFFU )
           goto Exit;
 
-        /* we didn't find a Unicode charmap -- synthetize one */
+        /* we didn't find a Unicode charmap -- synthesize one */
         cmaprec.face        = cffface;
         cmaprec.platform_id = 3;
         cmaprec.encoding_id = 1;
diff --git a/src/psaux/psconv.c b/src/psaux/psconv.c
index 3bbeab6..d824b59 100644
--- a/src/psaux/psconv.c
+++ b/src/psaux/psconv.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Some convenience conversions (body).                                 */
 /*                                                                         */
-/*  Copyright 2006 by                                                      */
+/*  Copyright 2006, 2008 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -187,10 +187,18 @@
         if ( c < 0 || c >= 10 )
           break;
 
-        if ( divider < 10000000L )
+        if ( !integral && power_ten > 0 )
         {
+          power_ten--;
           decimal = decimal * 10 + c;
-          divider *= 10;
+        }
+        else
+        {
+          if ( divider < 10000000L )
+          {
+            decimal = decimal * 10 + c;
+            divider *= 10;
+          }
         }
       }
     }