mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 07:46:12 +03:00
core: add Apple Color Emoji on macOS if its available
This commit is contained in:
@ -410,6 +410,21 @@ pub fn init(
|
|||||||
_ = try group.addFace(.bold_italic, .{ .deferred = face });
|
_ = try group.addFace(.bold_italic, .{ .deferred = face });
|
||||||
} else log.warn("font-family-bold-italic not found: {s}", .{family});
|
} else log.warn("font-family-bold-italic not found: {s}", .{family});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// On macOS, always search for and add the Apple Emoji font
|
||||||
|
// as our preferred emoji font for fallback. We do this in case
|
||||||
|
// people add other emoji fonts to their system, we always want to
|
||||||
|
// prefer the official one. Users can override this by explicitly
|
||||||
|
// specifying a font-family for emoji.
|
||||||
|
if (comptime builtin.os.tag == .macos) {
|
||||||
|
var disco_it = try disco.discover(alloc, .{
|
||||||
|
.family = "Apple Color Emoji",
|
||||||
|
});
|
||||||
|
defer disco_it.deinit();
|
||||||
|
if (try disco_it.next()) |face| {
|
||||||
|
_ = try group.addFace(.regular, .{ .fallback_deferred = face });
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Our built-in font will be used as a backup
|
// Our built-in font will be used as a backup
|
||||||
|
Reference in New Issue
Block a user