mirror of
https://github.com/erkin/ponysay.git
synced 2024-11-28 15:07:59 +01:00
try to fix cjk char width
This commit is contained in:
parent
170e3a323a
commit
02c3a69cf1
1 changed files with 4 additions and 0 deletions
|
@ -34,6 +34,8 @@ from balloon import *
|
|||
from colourstack import *
|
||||
from ucs import *
|
||||
|
||||
import unicodedata
|
||||
|
||||
|
||||
|
||||
class Backend():
|
||||
|
@ -457,6 +459,8 @@ class Backend():
|
|||
i += 1
|
||||
if not UCS.isCombining(c):
|
||||
rc += 1
|
||||
if unicodedata.east_asian_width(c) in ('W', 'A'):
|
||||
rc += 1
|
||||
return rc
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue