Insulate emoji test from system wcwidth
This commit is contained in:
parent
088087df73
commit
5c6be7f637
@ -6,11 +6,14 @@ from collections import OrderedDict
|
||||
|
||||
from kitty.constants import isosx
|
||||
from kitty.fast_data_types import (
|
||||
set_logical_dpi, set_send_sprite_to_gpu, sprite_map_set_layout,
|
||||
sprite_map_set_limits, test_render_line, test_sprite_position_for, wcwidth
|
||||
change_wcwidth, set_logical_dpi, set_send_sprite_to_gpu,
|
||||
sprite_map_set_layout, sprite_map_set_limits, test_render_line,
|
||||
test_sprite_position_for, wcwidth
|
||||
)
|
||||
from kitty.fonts.box_drawing import box_chars
|
||||
from kitty.fonts.render import prerender, render_string, set_font_family, shape_string
|
||||
from kitty.fonts.render import (
|
||||
prerender, render_string, set_font_family, shape_string
|
||||
)
|
||||
from kitty.utils import get_logical_dpi
|
||||
|
||||
from . import BaseTest
|
||||
@ -70,12 +73,16 @@ class Rendering(BaseTest):
|
||||
self.ae(len(cells), sz)
|
||||
|
||||
def test_shaping(self):
|
||||
change_wcwidth(True)
|
||||
try:
|
||||
|
||||
def groups(text, path=None):
|
||||
return [x[:2] for x in shape_string(text, path=path)]
|
||||
def groups(text, path=None):
|
||||
return [x[:2] for x in shape_string(text, path=path)]
|
||||
|
||||
self.ae(groups('abcd'), [(1, 1) for i in range(4)])
|
||||
self.ae(groups('A=>>B!=C', path='kitty_tests/FiraCode-Medium.otf'), [(1, 1), (3, 3), (1, 1), (2, 2), (1, 1)])
|
||||
self.ae(groups('|\U0001F601|\U0001F64f|\U0001F63a|'), [(1, 1), (2, 1), (1, 1), (2, 1), (1, 1), (2, 1), (1, 1)])
|
||||
self.ae(groups('He\u0347\u0305llo\u0337,', path='kitty_tests/LiberationMono-Regular.ttf'),
|
||||
[(1, 1), (1, 3), (1, 1), (1, 1), (1, 2), (1, 1)])
|
||||
self.ae(groups('abcd'), [(1, 1) for i in range(4)])
|
||||
self.ae(groups('A=>>B!=C', path='kitty_tests/FiraCode-Medium.otf'), [(1, 1), (3, 3), (1, 1), (2, 2), (1, 1)])
|
||||
self.ae(groups('|\U0001F601|\U0001F64f|\U0001F63a|'), [(1, 1), (2, 1), (1, 1), (2, 1), (1, 1), (2, 1), (1, 1)])
|
||||
self.ae(groups('He\u0347\u0305llo\u0337,', path='kitty_tests/LiberationMono-Regular.ttf'),
|
||||
[(1, 1), (1, 3), (1, 1), (1, 1), (1, 2), (1, 1)])
|
||||
finally:
|
||||
change_wcwidth(False)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user