mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-29 18:43:56 +00:00
font: start working on core text cell height calcs
This commit is contained in:
@@ -112,6 +112,22 @@ pub const Font = opaque {
|
||||
));
|
||||
}
|
||||
|
||||
pub fn getAscent(self: *Font) f64 {
|
||||
return c.CTFontGetAscent(@ptrCast(c.CTFontRef, self));
|
||||
}
|
||||
|
||||
pub fn getDescent(self: *Font) f64 {
|
||||
return c.CTFontGetDescent(@ptrCast(c.CTFontRef, self));
|
||||
}
|
||||
|
||||
pub fn getLeading(self: *Font) f64 {
|
||||
return c.CTFontGetLeading(@ptrCast(c.CTFontRef, self));
|
||||
}
|
||||
|
||||
pub fn getBoundingBox(self: *Font) graphics.Rect {
|
||||
return @bitCast(graphics.Rect, c.CTFontGetBoundingBox(@ptrCast(c.CTFontRef, self)));
|
||||
}
|
||||
|
||||
pub fn getUnderlinePosition(self: *Font) f64 {
|
||||
return c.CTFontGetUnderlinePosition(@ptrCast(c.CTFontRef, self));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user