font: handle missing CoreText display names

CTFontCopyDisplayName can return null.
This commit is contained in:
Mitchell Hashimoto
2026-08-05 13:55:19 -07:00
parent 168c7b9467
commit d166c05edd
2 changed files with 3 additions and 2 deletions

View File

@@ -156,7 +156,7 @@ pub const Font = opaque {
return @ptrFromInt(@intFromPtr(c.CTFontCopyFamilyName(@ptrCast(self))));
}
pub fn copyDisplayName(self: *Font) *foundation.String {
pub fn copyDisplayName(self: *Font) ?*foundation.String {
return @ptrFromInt(@intFromPtr(c.CTFontCopyDisplayName(@ptrCast(self))));
}