mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
font/coretext: calculate advance_x properly
This commit is contained in:
@ -397,6 +397,10 @@ pub const Face = struct {
|
||||
break :offset_y @intFromFloat(@ceil(baseline_with_offset));
|
||||
};
|
||||
|
||||
// Get our advance
|
||||
var advances: [glyphs.len]macos.graphics.Size = undefined;
|
||||
_ = self.font.getAdvancesForGlyphs(.horizontal, &glyphs, &advances);
|
||||
|
||||
// std.log.warn("renderGlyph rect={} width={} height={} render_x={} render_y={} offset_y={} ascent={} cell_height={} cell_baseline={}", .{
|
||||
// rect,
|
||||
// width,
|
||||
@ -416,10 +420,7 @@ pub const Face = struct {
|
||||
.offset_y = offset_y,
|
||||
.atlas_x = region.x,
|
||||
.atlas_y = region.y,
|
||||
|
||||
// This is not used, so we don't bother calculating it. If we
|
||||
// ever need it, we can calculate it using getAdvancesForGlyph.
|
||||
.advance_x = 0,
|
||||
.advance_x = @floatCast(advances[0].width),
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user