shithub: freetype+ttf2subf

Download patch

ref: b56680240a10db7e13cf5925a61946626d269c84
parent: 15dc278c5a23eb34c2d71b9a2fccd462a180890f
author: suzuki toshiya <[email protected]>
date: Fri Jul 31 20:32:07 EDT 2009

autofit: Count the size of the memory object by ptrdiff_t.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,25 @@
 2009-07-31  suzuki toshiya <[email protected]>
 
+	autofit: Count the size of the memory object by ptrdiff_t.
+
+	* src/autofit/afcjk.c (af_cjk_hint_edges): The
+	number of edges `n_edges' should be counted by
+	FT_PtrDist variable instead of FT_Int.
+
+	* src/autofit/aflatin.c (af_latin_hint_edges):
+	Ditto.
+
+	* src/autofit/aftypes.h: In AF_ScriptClassRec,
+	the size of metric `script_metrics_size' should
+	be counted by FT_Offset variable instead of FT_UInt.
+
+	* src/autofit/afhints.c
+	(af_glyph_hints_align_strong_points): The cursors
+	for the edges `min', `max', `mid' in the memory
+	buffer should be typed FT_PtrDist.
+
+2009-07-31  suzuki toshiya <[email protected]>
+
 	autofit: Fix for unused variable `first'.
 
 	* src/autofit/afhints.c (af_glyph_hints_reload): Insert
--- a/src/autofit/afcjk.c
+++ b/src/autofit/afcjk.c
@@ -1020,7 +1020,7 @@
     AF_AxisHints  axis       = &hints->axis[dim];
     AF_Edge       edges      = axis->edges;
     AF_Edge       edge_limit = edges + axis->num_edges;
-    FT_Int        n_edges;
+    FT_PtrDist    n_edges;
     AF_Edge       edge;
     AF_Edge       anchor   = 0;
     FT_Pos        delta    = 0;
--- a/src/autofit/afhints.c
+++ b/src/autofit/afhints.c
@@ -941,8 +941,8 @@
         }
 
         {
-          FT_UInt  min, max, mid;
-          FT_Pos   fpos;
+          FT_PtrDist  min, max, mid;
+          FT_Pos      fpos;
 
 
           /* find enclosing edges */
@@ -953,7 +953,7 @@
           /* for small edge counts, a linear search is better */
           if ( max <= 8 )
           {
-            FT_UInt  nn;
+            FT_PtrDist  nn;
 
             for ( nn = 0; nn < max; nn++ )
               if ( edges[nn].fpos >= u )
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -1701,7 +1701,7 @@
     AF_AxisHints  axis       = &hints->axis[dim];
     AF_Edge       edges      = axis->edges;
     AF_Edge       edge_limit = edges + axis->num_edges;
-    FT_Int        n_edges;
+    FT_PtrDist    n_edges;
     AF_Edge       edge;
     AF_Edge       anchor     = 0;
     FT_Int        has_serifs = 0;
--- a/src/autofit/aftypes.h
+++ b/src/autofit/aftypes.h
@@ -332,7 +332,7 @@
     AF_Script                   script;
     AF_Script_UniRange          script_uni_ranges; /* last must be { 0, 0 } */
 
-    FT_UInt                     script_metrics_size;
+    FT_Offset                   script_metrics_size;
     AF_Script_InitMetricsFunc   script_metrics_init;
     AF_Script_ScaleMetricsFunc  script_metrics_scale;
     AF_Script_DoneMetricsFunc   script_metrics_done;