From 19f003d7d021f7639a6103064ed85c494cd522b7 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 31 Oct 2022 09:44:19 -0700 Subject: [PATCH] mac: load emoji font last so it is not preferred for text --- src/Window.zig | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Window.zig b/src/Window.zig index fa409771f..02e8adc5c 100644 --- a/src/Window.zig +++ b/src/Window.zig @@ -303,21 +303,6 @@ pub fn create(alloc: Allocator, loop: libuv.Loop, config: *const Config) !*Windo } } - // If we're on Mac, then we try to use the Apple Emoji font for Emoji. - if (builtin.os.tag == .macos and font.Discover != void) { - var disco = font.Discover.init(); - defer disco.deinit(); - var disco_it = try disco.discover(.{ - .family = "Apple Color Emoji", - .size = font_size.points, - }); - defer disco_it.deinit(); - if (try disco_it.next()) |face| { - log.debug("font emoji: {s}", .{try face.name()}); - try group.addFace(alloc, .regular, face); - } - } - // Our built-in font will be used as a backup try group.addFace( alloc, @@ -345,6 +330,21 @@ pub fn create(alloc: Allocator, loop: libuv.Loop, config: *const Config) !*Windo ); } + // If we're on Mac, then we try to use the Apple Emoji font for Emoji. + if (builtin.os.tag == .macos and font.Discover != void) { + var disco = font.Discover.init(); + defer disco.deinit(); + var disco_it = try disco.discover(.{ + .family = "Apple Color Emoji", + .size = font_size.points, + }); + defer disco_it.deinit(); + if (try disco_it.next()) |face| { + log.debug("font emoji: {s}", .{try face.name()}); + try group.addFace(alloc, .regular, face); + } + } + break :group group; }); errdefer font_group.deinit(alloc);