mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-08-27 17:41:40 +00:00
font: look up Apple Color Emoji by exact name on macOS
The Apple Color Emoji fallback font was discovered with the generic discovery path, which builds a CTFontCollection and runs system-wide font matching. Since we know the exact font we want, we can look it up directly with CTFontCreateWithName instead.
This commit is contained in:
@@ -18,6 +18,17 @@ pub const Font = opaque {
|
||||
) orelse Allocator.Error.OutOfMemory;
|
||||
}
|
||||
|
||||
pub fn createWithName(name: *foundation.String, size: f32) Allocator.Error!*Font {
|
||||
return @as(
|
||||
?*Font,
|
||||
@ptrFromInt(@intFromPtr(c.CTFontCreateWithName(
|
||||
@ptrCast(name),
|
||||
size,
|
||||
null,
|
||||
))),
|
||||
) orelse Allocator.Error.OutOfMemory;
|
||||
}
|
||||
|
||||
pub fn createForString(
|
||||
self: *Font,
|
||||
str: *foundation.String,
|
||||
|
||||
Reference in New Issue
Block a user