summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexei Podtelezhnikov <apodtele@gmail.com>2023-03-07 17:35:15 +0000
committerAlexei Podtelezhnikov <apodtele@gmail.com>2023-03-07 17:35:15 +0000
commit839905475e4ed1730a43fe767783f8d61d039ea3 (patch)
treedbf6dae5ab44251ae5a1b8755a15419c4011da49
parentd5c6b948acbce11f0c4bd1989d2e6261586279e3 (diff)
downloadfreetype2-apodtele-master-patch-56869.tar.gz
[truetype] Round phantom points after instructions.apodtele-master-patch-56869
According to specifications, phantom points might be instructed to fit them to grid. Then rounding them before instructions might interfere. Other points are not touched before instructions either. * src/truetype/ttgload.c (TT_Hint_Glyph): Delay phantom point rounding until after instructions are applied.
-rw-r--r--src/truetype/ttgload.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 3998172cf..fb81be0f9 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -864,19 +864,6 @@
loader->exec->metrics.x_scale = loader->size->metrics->x_scale;
loader->exec->metrics.y_scale = loader->size->metrics->y_scale;
}
-#endif
-
- /* round phantom points */
- zone->cur[zone->n_points - 4].x =
- FT_PIX_ROUND( zone->cur[zone->n_points - 4].x );
- zone->cur[zone->n_points - 3].x =
- FT_PIX_ROUND( zone->cur[zone->n_points - 3].x );
- zone->cur[zone->n_points - 2].y =
- FT_PIX_ROUND( zone->cur[zone->n_points - 2].y );
- zone->cur[zone->n_points - 1].y =
- FT_PIX_ROUND( zone->cur[zone->n_points - 1].y );
-
-#ifdef TT_USE_BYTECODE_INTERPRETER
if ( n_ins > 0 )
{
@@ -900,8 +887,17 @@
current_outline.tags[0] |=
( loader->exec->GS.scan_type << 5 ) | FT_CURVE_TAG_HAS_SCANMODE;
}
+#endif /* TT_USE_BYTECODE_INTERPRETER */
-#endif
+ /* round phantom points */
+ zone->cur[zone->n_points - 4].x =
+ FT_PIX_ROUND( zone->cur[zone->n_points - 4].x );
+ zone->cur[zone->n_points - 3].x =
+ FT_PIX_ROUND( zone->cur[zone->n_points - 3].x );
+ zone->cur[zone->n_points - 2].y =
+ FT_PIX_ROUND( zone->cur[zone->n_points - 2].y );
+ zone->cur[zone->n_points - 1].y =
+ FT_PIX_ROUND( zone->cur[zone->n_points - 1].y );
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
/* Save possibly modified glyph phantom points unless in v40 backward */