mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-08-28 18:11:39 +00:00
feat(font): Non-integer point sizes
Allows for high dpi displays to get odd numbered pixel sizes, for example, 13.5pt @ 2px/pt for 27px font. This implementation performs all the sizing calculations with f32, rounding to the nearest pixel size when it comes to rendering. In the future this can be enhanced by adding fractional scaling to support fractional pixel sizes.
This commit is contained in:
@@ -575,7 +575,9 @@ pub const Key = struct {
|
||||
/// Hash the key with the given hasher.
|
||||
pub fn hash(self: Key, hasher: anytype) void {
|
||||
const autoHash = std.hash.autoHash;
|
||||
autoHash(hasher, self.font_size);
|
||||
autoHash(hasher, @as(u32, @bitCast(self.font_size.points)));
|
||||
autoHash(hasher, @as(u32, @bitCast(self.font_size.xdpi)));
|
||||
autoHash(hasher, @as(u32, @bitCast(self.font_size.ydpi)));
|
||||
autoHash(hasher, self.descriptors.len);
|
||||
for (self.descriptors) |d| d.hash(hasher);
|
||||
self.codepoint_map.hash(hasher);
|
||||
|
||||
Reference in New Issue
Block a user