Use em size as nerd font reference metric

This commit is contained in:
Daniel Wennberg
2025-07-15 13:04:51 -07:00
parent e7d28a85c8
commit ce507f35df
3 changed files with 7 additions and 25 deletions

View File

@@ -299,14 +299,17 @@ fn collection(
);
// Nerd-font symbols fallback.
// For proper icon scaling, this should be loaded at the same point
// size as the primary font and not undergo size normalization,
// hence we use the em size as scale reference.
_ = try c.add(
self.alloc,
.regular,
.init(.{ .fallback_loaded = try Face.init(
.initWithScaleReference(.{ .fallback_loaded = try .init(
self.font_lib,
font.embedded.symbols_nerd_font,
load_options.faceOptions(),
) }),
) }, .em_size),
);
// On macOS, always search for and add the Apple Emoji font