mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 14:18:26 +02:00
Fix vertical positioning when rendering characters
This commit is contained in:
@@ -147,8 +147,8 @@ def render_char(text, bold=False, italic=False, size_in_pts=None):
|
|||||||
raise ValueError(
|
raise ValueError(
|
||||||
'FreeType rendered the glyph for {!r} with an unsupported pixel mode: {}'.format(text, bitmap.pixel_mode))
|
'FreeType rendered the glyph for {!r} with an unsupported pixel mode: {}'.format(text, bitmap.pixel_mode))
|
||||||
m = face.glyph.metrics
|
m = face.glyph.metrics
|
||||||
return CharBitmap(bitmap.buffer, min(int(abs(m.horiBearingX) / 64), bitmap.width),
|
return CharBitmap(bitmap.buffer, int(abs(m.horiBearingX) / 64),
|
||||||
min(int(abs(m.horiBearingY) / 64), bitmap.rows), int(m.horiAdvance / 64), bitmap.rows, bitmap.width)
|
int(abs(m.horiBearingY) / 64), int(m.horiAdvance / 64), bitmap.rows, bitmap.width)
|
||||||
|
|
||||||
|
|
||||||
def is_wide_char(bitmap_char):
|
def is_wide_char(bitmap_char):
|
||||||
@@ -262,7 +262,7 @@ def cell_size():
|
|||||||
return cell_width, cell_height
|
return cell_width, cell_height
|
||||||
|
|
||||||
|
|
||||||
def test_rendering(text='Ping👁a⧽', sz=144, family='monospace'):
|
def test_rendering(text='\'Ping👁a⧽', sz=144, family='monospace'):
|
||||||
set_font_family(family, sz)
|
set_font_family(family, sz)
|
||||||
cells = []
|
cells = []
|
||||||
for c in text:
|
for c in text:
|
||||||
|
|||||||
Reference in New Issue
Block a user