From 3f1942223b071318c7e61c8d1786d4ca7e526d3c Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 6 Sep 2022 14:26:43 -0700 Subject: [PATCH] only test presentation VS15/16 if directly adjacent to codepoint --- src/font/Shaper.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/font/Shaper.zig b/src/font/Shaper.zig index 63eb4a482..4dd03c990 100644 --- a/src/font/Shaper.zig +++ b/src/font/Shaper.zig @@ -177,8 +177,10 @@ pub const RunIterator = struct { // Determine the presentation format for this glyph. const presentation: ?Presentation = if (cell.attrs.grapheme) p: { + // We only check the FIRST codepoint because I believe the + // presentation format must be directly adjacent to the codepoint. var it = self.row.codepointIterator(j); - while (it.next()) |cp| { + if (it.next()) |cp| { if (cp == 0xFE0E) break :p Presentation.text; if (cp == 0xFE0F) break :p Presentation.emoji; }