font/coretext: don't use vertical overlap constraints

This commit is contained in:
Qwerasd
2025-07-09 10:28:35 -06:00
parent 731da5aea5
commit b915084c38

View File

@ -343,7 +343,14 @@ pub const Face = struct {
const cell_width: f64 = @floatFromInt(metrics.cell_width);
// const cell_height: f64 = @floatFromInt(metrics.cell_height);
const glyph_size = opts.constraint.constrain(
// We eliminate any negative vertical padding since these overlap
// values aren't needed under CoreText with how precisely we apply
// constraints, and they can lead to extra height that looks bad
// for things like powerline glyphs.
var constraint = opts.constraint;
constraint.pad_top = @max(0.0, constraint.pad_top);
constraint.pad_bottom = @max(0.0, constraint.pad_bottom);
const glyph_size = constraint.constrain(
.{
.width = rect.size.width,
.height = rect.size.height,