font: log warning when rejecting ic_width
parent
a72995590b
commit
9aa1698e5a
|
|
@ -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 "<Error getting font name>";
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 "<Error getting font name>";
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue