shithub: freetype+ttf2subf

Download patch

ref: 9fc4094375d0bc2d06167b7306fafad28eba7909
parent: c9c64388403a4e73b1d2686c5d6c4a91111b4f49
author: suzuki toshiya <[email protected]>
date: Fri Jul 31 20:32:14 EDT 2009

truetype: Cast the scaling params to 32-bit for LP64 system.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2009-07-31  suzuki toshiya <[email protected]>
 
+	truetype: Cast the scaling params to 32-bit for LP64 system.
+
+	* src/truetype/ttgload.c (TT_Process_Composite_Component):
+	Insert casts from long (return value of FT_MulFix()) to
+	FT_Int32 (the argument to FT_SqrtFixed()).
+
+2009-07-31  suzuki toshiya <[email protected]>
+
 	sfnt: Cast a character code to FT_UInt32 for LP64 system.
 
 	* src/sfnt/ttcmap.c (tt_cmap14_char_map_nondef_binary,
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -936,15 +936,15 @@
   /* This algorithm is a guess and works much better than the above.       */
   /*                                                                       */
         FT_Fixed  mac_xscale = FT_SqrtFixed(
-                                 FT_MulFix( subglyph->transform.xx,
-                                            subglyph->transform.xx ) +
-                                 FT_MulFix( subglyph->transform.xy,
-                                            subglyph->transform.xy ) );
+                                 (FT_Int32)FT_MulFix( subglyph->transform.xx,
+                                                      subglyph->transform.xx ) +
+                                 (FT_Int32)FT_MulFix( subglyph->transform.xy,
+                                                      subglyph->transform.xy ) );
         FT_Fixed  mac_yscale = FT_SqrtFixed(
-                                 FT_MulFix( subglyph->transform.yy,
-                                            subglyph->transform.yy ) +
-                                 FT_MulFix( subglyph->transform.yx,
-                                            subglyph->transform.yx ) );
+                                 (FT_Int32)FT_MulFix( subglyph->transform.yy,
+                                                      subglyph->transform.yy ) +
+                                 (FT_Int32)FT_MulFix( subglyph->transform.yx,
+                                                      subglyph->transform.yx ) );
 
 
         x = FT_MulFix( x, mac_xscale );