mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
font: fix sign of usWinDescent interpretation (#2960)
comment explains In the future we should probably find or craft example fonts that have weird metrics in their tables and make unit tests for them.
This commit is contained in:
@ -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,
|
||||
};
|
||||
};
|
||||
|
@ -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,
|
||||
};
|
||||
};
|
||||
|
Reference in New Issue
Block a user