pkg/macos: CTFontCreateForString

This commit is contained in:
Mitchell Hashimoto
2024-05-05 21:38:19 -07:00
parent a29a0a1e5c
commit 1189817dd8

View File

@ -18,6 +18,18 @@ pub const Font = opaque {
) orelse Allocator.Error.OutOfMemory;
}
pub fn createForString(
self: *Font,
str: *foundation.String,
range: foundation.Range,
) ?*Font {
return @ptrCast(@constCast(c.CTFontCreateForString(
@ptrCast(self),
@ptrCast(str),
@bitCast(range),
)));
}
pub fn copyWithAttributes(
self: *Font,
size: f32,