From 02c3a69cf1df514a512c8ad9eec650f294b8148a Mon Sep 17 00:00:00 2001 From: Jiachen Yang Date: Mon, 13 Apr 2015 01:05:57 +0900 Subject: [PATCH] try to fix cjk char width --- src/backend.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend.py b/src/backend.py index 8c4bdfc1..9b071426 100755 --- a/src/backend.py +++ b/src/backend.py @@ -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