Linux: use only advances for calculating cell sizes

There are apparently monospace fonts whose characters are not actually
monospaced when rendered, for example, Liberation Mono. It has
characters that when rendered result in bitmaps wider than the advance.

So we use only the advance as that is what most linux software seems to
do. Fixes #47
This commit is contained in:
Kovid Goyal 2017-02-09 13:36:44 +05:30
parent e2ac9ec118
commit 7e34807859

View File

@ -34,7 +34,7 @@ def calc_cell_width(font, face):
ch = chr(i)
load_char(font, face, ch)
m = face.glyph_metrics()
ans = max(ans, max(ceil_int(m.horiAdvance / 64), face.bitmap().width))
ans = max(ans, ceil_int(m.horiAdvance / 64))
return ans