shithub: freetype+ttf2subf

Download patch

ref: 048b756389b8e8cd9c60f1d3e4f1d6a575004c3d
parent: c32e83f23f0bf6562f307f69b3b89be4276d06d1
author: Werner Lemberg <[email protected]>
date: Sun Apr 13 01:55:36 EDT 2008

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

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-04-13  Werner Lemberg  <[email protected]>
+
+	* src/psaux/psconv.c (PS_Conv_ToFixed): Increase precision if
+	integer part is zero.
+
 2008-04-01  Werner Lemberg  <[email protected]>
 
 	Fix compilation with g++ 4.1 (with both `single' and `multi'
--- 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;
   }
 
 
--- 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 );
   }
 
 
--- 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;
--- 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;
+          }
         }
       }
     }