From c2cc2b8f0386f56865c2ff68c41dd136e03d6e62 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 24 Sep 2023 20:35:05 -0700 Subject: [PATCH] core: hook up the codepoint map to the loaded font group --- src/Surface.zig | 5 +++++ src/config/Config.zig | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/Surface.zig b/src/Surface.zig index 7bbe31745..d64147f0d 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -224,6 +224,11 @@ pub fn init( var group = try font.Group.init(alloc, font_lib, font_size); errdefer group.deinit(); + // If we have codepoint mappings, set those. + if (config.@"font-codepoint-map".map.list.len > 0) { + group.codepoint_map = config.@"font-codepoint-map".map; + } + // Search for fonts if (font.Discover != void) discover: { const disco = try app.fontDiscover() orelse { diff --git a/src/config/Config.zig b/src/config/Config.zig index 2a422dbdf..e28663984 100644 --- a/src/config/Config.zig +++ b/src/config/Config.zig @@ -104,6 +104,9 @@ const c = @cImport({ /// /// This configuration can be repeated multiple times to specify multiple /// codepoint mappings. +/// +/// Changing this configuration at runtime will only affect new terminals, +/// i.e. new windows, tabs, etc. @"font-codepoint-map": RepeatableCodepointMap = .{}, /// Draw fonts with a thicker stroke, if supported. This is only supported