freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ft-devel] 'gvar' patch


From: Behdad Esfahbod
Subject: [ft-devel] 'gvar' patch
Date: Tue, 1 Mar 2016 20:01:06 +0900

Hi Werner,

I've convinced myself that the following patch fixes a bug in FreeType's implementation of 'gvar'.  I still don't have any test fonts to show it.  Will have in a few days.

We probably did not notice this as all fonts we tested had only tuple_coords[i] be +1 or -1 for non-intermediate tuples.

diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index 6b29a83..15fd046 100644
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -646,10 +646,9 @@
         FT_TRACE6(( "      tuple coordinate value %.4f fits\n",
                     tuple_coords[i] / 65536.0 ));
         /* not an intermediate tuple */
-        apply = FT_MulFix( apply,
-                           blend->normalizedcoords[i] > 0
-                             ? blend->normalizedcoords[i]
-                             : -blend->normalizedcoords[i] );
+        apply = FT_MulDiv( apply,
+                           blend->normalizedcoords[i],
+                           tuple_coords[i] );
       }
 
       else if ( blend->normalizedcoords[i] < im_start_coords[i] ||


--

reply via email to

[Prev in Thread] Current Thread [Next in Thread]