mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
Merge pull request #860 from mitchellh/ct-leading
font/coretext: ignore typographic leading when calculating cell height
This commit is contained in:
@ -466,10 +466,15 @@ pub const Face = struct {
|
||||
} = metrics: {
|
||||
const ascent = @round(ct_font.getAscent());
|
||||
const descent = @round(ct_font.getDescent());
|
||||
const leading = @round(ct_font.getLeading());
|
||||
|
||||
// Leading is the value between lines at the TOP of a line.
|
||||
// Because we are rendering a fixed size terminal grid, we
|
||||
// want the leading to be split equally between the top and bottom.
|
||||
const leading = ct_font.getLeading();
|
||||
|
||||
break :metrics .{
|
||||
.height = @floatCast(ascent + descent + leading),
|
||||
.ascent = @floatCast(ascent),
|
||||
.height = @floatCast(@round(ascent + descent + leading)),
|
||||
.ascent = @floatCast(@round(ascent + (leading / 2))),
|
||||
};
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user