mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-08-29 18:41:40 +00:00
font: start working on core text cell height calcs
This commit is contained in:
@@ -118,7 +118,12 @@ pub const Face = struct {
|
||||
break :cell_width @floatCast(f32, max);
|
||||
};
|
||||
|
||||
std.log.warn("width={}", .{cell_width});
|
||||
const cell_height: f32 = cell_height: {
|
||||
const diff = ct_font.getAscent() + ct_font.getDescent() + ct_font.getLeading();
|
||||
break :cell_height @floatCast(f32, diff);
|
||||
};
|
||||
|
||||
std.log.warn("width={}, height={}", .{ cell_width, cell_height });
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -389,7 +389,7 @@ test {
|
||||
|
||||
var ft_font = try Face.init(lib, testFont, .{ .points = 12 });
|
||||
defer ft_font.deinit();
|
||||
//log.warn("FT WIDTH={}", .{ft_font.metrics.cell_width});
|
||||
log.warn("FT={}", .{ft_font.metrics});
|
||||
|
||||
try testing.expectEqual(Presentation.text, ft_font.presentation);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user