Commit 69d1a3609e207e2666ac3f67eb1798408ce8f5eb

Werner Lemberg 2013-12-10T10:12:27

[truetype] Fix scaling of vertical phantom points. * src/truetype/ttgload.c (load_truetype_glyph): Scale pp3.x and pp4.x also.

diff --git a/ChangeLog b/ChangeLog
index d06ec93..8a1d51f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2013-12-10  Werner Lemberg  <wl@gnu.org>
 
+	[truetype] Fix scaling of vertical phantom points.
+
+	* src/truetype/ttgload.c (load_truetype_glyph): Scale pp3.x and
+	pp4.x also.
+
+2013-12-10  Werner Lemberg  <wl@gnu.org>
+
 	[truetype] Fix positioning of composite glyphs.
 	Problem reported by Nigel Tao <nigeltao@golang.org>.
 
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 4a551d4..1f82a1d 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -1574,13 +1574,19 @@
         FT_FREE( deltas );
       }
 
-#endif
+#endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
 
+      /* scale phantom points, if necessary; */
+      /* they get rounded in `TT_Hint_Glyph' */
       if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )
       {
         loader->pp1.x = FT_MulFix( loader->pp1.x, x_scale );
         loader->pp2.x = FT_MulFix( loader->pp2.x, x_scale );
+        /* pp1.y and pp2.y are always zero */
+
+        loader->pp3.x = FT_MulFix( loader->pp3.x, x_scale );
         loader->pp3.y = FT_MulFix( loader->pp3.y, y_scale );
+        loader->pp4.x = FT_MulFix( loader->pp4.x, x_scale );
         loader->pp4.y = FT_MulFix( loader->pp4.y, y_scale );
       }
 
@@ -1695,11 +1701,17 @@
 
 #endif /* TT_CONFIG_OPTION_GX_VAR_SUPPORT */
 
+      /* scale phantom points, if necessary; */
+      /* they get rounded in `TT_Hint_Glyph' */
       if ( ( loader->load_flags & FT_LOAD_NO_SCALE ) == 0 )
       {
         loader->pp1.x = FT_MulFix( loader->pp1.x, x_scale );
         loader->pp2.x = FT_MulFix( loader->pp2.x, x_scale );
+        /* pp1.y and pp2.y are always zero */
+
+        loader->pp3.x = FT_MulFix( loader->pp3.x, x_scale );
         loader->pp3.y = FT_MulFix( loader->pp3.y, y_scale );
+        loader->pp4.x = FT_MulFix( loader->pp4.x, x_scale );
         loader->pp4.y = FT_MulFix( loader->pp4.y, y_scale );
       }