font: fix sign of usWinDescent interpretation

This commit is contained in:
Qwerasd
2024-12-13 13:14:49 -05:00
parent b2a9af7359
commit 4573890f22
2 changed files with 6 additions and 2 deletions

View File

@ -647,7 +647,9 @@ pub const Face = struct {
const win_descent: f64 = @floatFromInt(os2.usWinDescent);
break :vertical_metrics .{
win_ascent * px_per_unit,
win_descent * px_per_unit,
// usWinDescent is *positive* -> down unlike sTypoDescender
// and hhea.Descender, so we flip its sign to fix this.
-win_descent * px_per_unit,
0.0,
};
};

View File

@ -689,7 +689,9 @@ pub const Face = struct {
const win_descent: f64 = @floatFromInt(os2.usWinDescent);
break :vertical_metrics .{
win_ascent * px_per_unit,
win_descent * px_per_unit,
// usWinDescent is *positive* -> down unlike sTypoDescender
// and hhea.Descender, so we flip its sign to fix this.
-win_descent * px_per_unit,
0.0,
};
};