mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-10 06:05:26 +02:00
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:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user