pkg/macos: create fonts from data

This commit is contained in:
Mitchell Hashimoto
2022-10-08 10:21:33 -07:00
parent d0e269df6a
commit 26629bcb6e

View File

@ -11,3 +11,12 @@ pub fn createFontDescriptorsFromURL(url: *foundation.URL) ?*foundation.Array {
)), )),
); );
} }
pub fn createFontDescriptorsFromData(data: *foundation.Data) ?*foundation.Array {
return @intToPtr(
?*foundation.Array,
@ptrToInt(c.CTFontManagerCreateFontDescriptorsFromData(
@ptrCast(c.CFDataRef, data),
)),
);
}