try to fix cjk char width

This commit is contained in:
Jiachen Yang 2015-04-13 01:05:57 +09:00
parent 170e3a323a
commit 02c3a69cf1

View file

@ -34,6 +34,8 @@ from balloon import *
from colourstack import * from colourstack import *
from ucs import * from ucs import *
import unicodedata
class Backend(): class Backend():
@ -457,6 +459,8 @@ class Backend():
i += 1 i += 1
if not UCS.isCombining(c): if not UCS.isCombining(c):
rc += 1 rc += 1
if unicodedata.east_asian_width(c) in ('W', 'A'):
rc += 1
return rc return rc