font: coretext calculate cell metrics

This commit is contained in:
Mitchell Hashimoto
2022-10-09 10:57:19 -07:00
parent 150b0a4d51
commit 1b7bc052d4
5 changed files with 177 additions and 11 deletions

View File

@@ -23,6 +23,10 @@ pub const String = opaque {
c.CFRelease(self);
}
pub fn getLength(self: *String) usize {
return @intCast(usize, c.CFStringGetLength(@ptrCast(c.CFStringRef, self)));
}
pub fn hasPrefix(self: *String, prefix: *String) bool {
return c.CFStringHasPrefix(
@ptrCast(c.CFStringRef, self),