font: grapheme clusters need to find a single font for all codepoints

When font shaping grapheme clusters, we erroneously used the font index
of a font that only matches the first codepoint in the cell. This led to the
combining characters being [usually] unknown and rendering as boxes.

For a grapheme, we must find a font face that has a glyph for _all codepoints_
in the grapheme.

This also fixes an issue where we now properly render the unicode replacement
character if we can't find a font satisfying a codepoint.
This commit is contained in:
Mitchell Hashimoto
2023-08-26 09:20:26 -07:00
parent 39c2332d35
commit e6edf3105e
4 changed files with 138 additions and 24 deletions

View File

@@ -623,6 +623,10 @@ pub const CodepointIterator = struct {
},
}
}
pub fn reset(self: *CodepointIterator) void {
self.i = 0;
}
};
/// RowIndex represents a row within the screen. There are various meanings