Read kerning table (untested cause there ain't one)

This commit is contained in:
2026-09-20 15:43:30 +02:00
parent 183e825827
commit ff72311979
6 changed files with 34 additions and 6 deletions

View File

@@ -605,11 +605,13 @@ pub fn printLine(self: *Gui, comptime fmt: []const u8, fmt_args: anytype, print_
var cursor_offset_em = glyph_data.bottom_left_em;
cursor_offset_em.y = -cursor_offset_em.y;
cursor_offset_em.x += glyph_data.left_side_bearing_em;
if (maybe_prev_glyph == null) {
cursor_offset_em.x += glyph_data.left_side_bearing_em;
}
if (maybe_prev_glyph) |prev_glyph| {
const kerning_em = font.kerning_em.get(.{ prev_glyph, glyph_id }) orelse 0;
cursor_offset_em.x += kerning_em;
cursor_sspx.x += kerning_em;
}
if (glyph_data.gpu_glyph_id) |gpu_glyph_id| {