mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-25 13:16:11 +03:00
@ -468,17 +468,20 @@ pub const Face = struct {
|
|||||||
height: f32,
|
height: f32,
|
||||||
ascent: f32,
|
ascent: f32,
|
||||||
} = metrics: {
|
} = metrics: {
|
||||||
const ascent = @round(ct_font.getAscent());
|
const ascent = ct_font.getAscent();
|
||||||
const descent = @round(ct_font.getDescent());
|
const descent = ct_font.getDescent();
|
||||||
|
|
||||||
// Leading is the value between lines at the TOP of a line.
|
// Leading is the value between lines at the TOP of a line.
|
||||||
// Because we are rendering a fixed size terminal grid, we
|
// Because we are rendering a fixed size terminal grid, we
|
||||||
// want the leading to be split equally between the top and bottom.
|
// want the leading to be split equally between the top and bottom.
|
||||||
const leading = ct_font.getLeading();
|
const leading = ct_font.getLeading();
|
||||||
|
|
||||||
|
// We ceil the metrics below because we don't want to cut off any
|
||||||
|
// potential used pixels. This tends to only make a one pixel
|
||||||
|
// difference but at small font sizes this can be noticeable.
|
||||||
break :metrics .{
|
break :metrics .{
|
||||||
.height = @floatCast(@round(ascent + descent + leading)),
|
.height = @floatCast(@ceil(ascent + descent + leading)),
|
||||||
.ascent = @floatCast(@round(ascent + (leading / 2))),
|
.ascent = @floatCast(@ceil(ascent + (leading / 2))),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user