workaround for shitty libxft issue

This commit is contained in:
speedie 2022-12-05 20:12:53 +01:00
parent 99dfaf066f
commit 3c68c3efa9

6
x.c
View file

@ -1063,7 +1063,11 @@ xloadfont(Font *f, FcPattern *pattern)
f->rbearing = f->match->max_advance_width;
f->height = f->ascent + f->descent;
f->width = DIVCEIL(extents.xOff, strlen(ascii_printable));
//f->width = DIVCEIL(extents.xOff, strlen(ascii_printable));
unsigned short xoff = extents.xOff;
signed xdelta = xoff - extents.width;
_Bool isnewfont = abs(xdelta) > 18;
f->width = DIVCEIL(isnewfont ? xoff / 3 : xoff, strlen(ascii_printable));
return 0;
}