freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] master 361af72 2/3: [truetype] Correctly handle variation fo


From: Werner LEMBERG
Subject: [freetype2] master 361af72 2/3: [truetype] Correctly handle variation font phantom points (#52683).
Date: Mon, 18 Dec 2017 01:32:10 -0500 (EST)

branch: master
commit 361af72eea8f3e72041c4278d5d5442389771330
Author: Jonathan Kew <address@hidden>
Commit: Werner Lemberg <address@hidden>

    [truetype] Correctly handle variation font phantom points (#52683).
    
    * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Fix phantom
    point indices.
---
 ChangeLog              |  7 +++++++
 src/truetype/ttgxvar.c | 22 +++++++++++-----------
 2 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 82830ad..52a56cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2017-12-17  Jonathan Kew  <address@hidden>
 
+       [truetype] Correctly handle variation font phantom points (#52683).
+
+       * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Fix phantom
+       point indices.
+
+2017-12-17  Jonathan Kew  <address@hidden>
+
        Fix incorrect advance width scaling (#52683).
 
        * src/base/ftadvance.c (FT_Get_Advances): Always respect the
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index 9aa4825..f490c36 100644
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -3630,7 +3630,7 @@
           FT_Pos  delta_y = FT_MulFix( deltas_y[j], apply );
 
 
-          if ( j < n_points - 3 )
+          if ( j < n_points - 4 )
           {
             outline->points[j].x += delta_x;
             outline->points[j].y += delta_y;
@@ -3640,25 +3640,25 @@
             /* To avoid double adjustment of advance width or height, */
             /* adjust phantom points only if there is no HVAR or VVAR */
             /* support, respectively.                                 */
-            if ( j == ( n_points - 3 )          &&
-                 !( face->variation_support   &
-                    TT_FACE_FLAG_VAR_HADVANCE ) )
+            if ( j == ( n_points - 4 )        &&
+                 !( face->variation_support &
+                    TT_FACE_FLAG_VAR_LSB    ) )
+              outline->points[j].x += delta_x;
+
+            else if ( j == ( n_points - 3 )          &&
+                      !( face->variation_support   &
+                         TT_FACE_FLAG_VAR_HADVANCE ) )
               outline->points[j].x += delta_x;
 
             else if ( j == ( n_points - 2 )        &&
                       !( face->variation_support &
-                         TT_FACE_FLAG_VAR_LSB    ) )
-              outline->points[j].x += delta_x;
+                         TT_FACE_FLAG_VAR_TSB    ) )
+              outline->points[j].y += delta_y;
 
             else if ( j == ( n_points - 1 )          &&
                       !( face->variation_support   &
                          TT_FACE_FLAG_VAR_VADVANCE ) )
               outline->points[j].y += delta_y;
-
-            else if ( j == ( n_points - 0 )        &&
-                      !( face->variation_support &
-                         TT_FACE_FLAG_VAR_TSB    ) )
-              outline->points[j].y += delta_y;
           }
 
 #ifdef FT_DEBUG_LEVEL_TRACE



reply via email to

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