summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Wagner <bungeman@google.com>2019-07-12 10:48:10 +0200
committerWerner Lemberg <wl@gnu.org>2019-07-12 10:48:10 +0200
commit12e4307dc7b48c9a4a4fc3ac6c32220874ab18ec (patch)
tree58911b38444d065eabfa6bf636a458a963cb363a
parent05439f5cc69eaa3deaf3db52a7999af09a2c293a (diff)
downloadfreetype2-12e4307dc7b48c9a4a4fc3ac6c32220874ab18ec.tar.gz
Properly handle phantom points for variation fonts (#56601).
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Scale phantom points if HVAR and/or VVAR is present.
-rw-r--r--ChangeLog7
-rw-r--r--src/truetype/ttgload.c27
2 files changed, 28 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 84c29a997..27b4c0d10 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2019-07-12 Ben Wagner <bungeman@google.com>
+
+ Properly handle phantom points for variation fonts (#56601).
+
+ * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Scale phantom
+ points if HVAR and/or VVAR is present.
+
2019-07-04 Werner Lemberg <wl@gnu.org>
[psaux] (2/2) Handle fonts that use SEAC for ligatures (#56580).
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index a04684086..093eed839 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -1102,9 +1102,16 @@
}
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- /* if we have a HVAR table, `pp1' and/or `pp2' are already adjusted */
- if ( !( loader->face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) ||
- !IS_HINTED( loader->load_flags ) )
+ /* if we have a HVAR table, `pp1' and/or `pp2' */
+ /* are already adjusted but unscaled */
+ if ( ( loader->face->variation_support & TT_FACE_FLAG_VAR_HADVANCE ) &&
+ IS_HINTED( loader->load_flags ) )
+ {
+ 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 */
+ }
+ else
#endif
{
loader->pp1 = outline->points[n_points - 4];
@@ -1112,9 +1119,17 @@
}
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
- /* if we have a VVAR table, `pp3' and/or `pp4' are already adjusted */
- if ( !( loader->face->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) ||
- !IS_HINTED( loader->load_flags ) )
+ /* if we have a VVAR table, `pp3' and/or `pp4' */
+ /* are already adjusted but unscaled */
+ if ( ( loader->face->variation_support & TT_FACE_FLAG_VAR_VADVANCE ) &&
+ IS_HINTED( loader->load_flags ) )
+ {
+ 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 );
+ }
+ else
#endif
{
loader->pp3 = outline->points[n_points - 2];