diff --git a/src/font/face/coretext.zig b/src/font/face/coretext.zig index 8edee8baa..a85c94430 100644 --- a/src/font/face/coretext.zig +++ b/src/font/face/coretext.zig @@ -827,6 +827,16 @@ pub const Face = struct { // patched with the nerd fonts patcher and it butchers the advance // values so the advance ends up half the width of the actual glyph. if (bounds.size.width > advance) { + var buf: [1024]u8 = undefined; + const font_name = self.name(&buf) catch ""; + log.warn( + "(getMetrics) Width of glyph '水' for font \"{s}\" is greater than its advance ({d} > {d}), discarding ic_width metric.", + .{ + font_name, + bounds.size.width, + advance, + }, + ); break :ic_width null; } diff --git a/src/font/face/freetype.zig b/src/font/face/freetype.zig index 6ed1c8adb..1d8d2efff 100644 --- a/src/font/face/freetype.zig +++ b/src/font/face/freetype.zig @@ -1018,6 +1018,16 @@ pub const Face = struct { // patched with the nerd fonts patcher and it butchers the advance // values so the advance ends up half the width of the actual glyph. if (ft_glyph.*.metrics.width > ft_glyph.*.advance.x) { + var buf: [1024]u8 = undefined; + const font_name = self.name(&buf) catch ""; + log.warn( + "(getMetrics) Width of glyph '水' for font \"{s}\" is greater than its advance ({d} > {d}), discarding ic_width metric.", + .{ + font_name, + f26dot6ToF64(ft_glyph.*.metrics.width), + f26dot6ToF64(ft_glyph.*.advance.x), + }, + ); break :ic_width null; }