From 3cf7d32b90ad32321c141bb2a34a670d2d6df5b7 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Fri, 8 Dec 2023 10:55:02 +0800 Subject: [PATCH] Display glyphs whose first contours commence at origin * src/sfnt.c (sfnt_build_append): Don't disregard redundant motion if outline is empty. Problem encountered in the "M" glyph within Source Code Pro VF Italic. --- src/sfnt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/sfnt.c b/src/sfnt.c index 8ec19290859..34239973797 100644 --- a/src/sfnt.c +++ b/src/sfnt.c @@ -3487,12 +3487,18 @@ sfnt_build_append (int flags, sfnt_fixed x, sfnt_fixed y) { struct sfnt_glyph_outline *outline; + outline = build_outline_context.outline; + if (x == build_outline_context.x - && y == build_outline_context.y) + && y == build_outline_context.y + /* If the outline is presently empty, the first move_to must be + recorded even if its X and Y are set to origin. Without this + initial vertex, edges will be generated from the next vertex + onward, and thus be misaligned. */ + && outline->outline_used) /* Ignore redundant motion. */ return build_outline_context.outline; - outline = build_outline_context.outline; outline->outline_used++; /* See if the outline has to be extended. Checking for overflow -- 2.39.2