diff --git a/src/cli/list_fonts.zig b/src/cli/list_fonts.zig index 5312e4c6a..1b7c9bcb5 100644 --- a/src/cli/list_fonts.zig +++ b/src/cli/list_fonts.zig @@ -72,9 +72,11 @@ fn runArgs(alloc_gpa: Allocator, argsIter: anytype) !u8 { }; const full_name = try alloc.dupe(u8, full_name_buf); - try families.append(family); const gop = try map.getOrPut(family); - if (!gop.found_existing) gop.value_ptr.* = .{}; + if (!gop.found_existing) { + try families.append(family); + gop.value_ptr.* = .{}; + } try gop.value_ptr.append(alloc, full_name); } diff --git a/src/font/discovery.zig b/src/font/discovery.zig index 7bd7900f5..19b7141d6 100644 --- a/src/font/discovery.zig +++ b/src/font/discovery.zig @@ -198,7 +198,7 @@ pub const Fontconfig = struct { pat.defaultSubstitute(); // Search - const res = self.fc_config.fontSort(pat, true, null); + const res = self.fc_config.fontSort(pat, false, null); if (res.result != .match) return error.FontConfigFailed; errdefer res.fs.destroy();