From 02c3a69cf1df514a512c8ad9eec650f294b8148a Mon Sep 17 00:00:00 2001 From: Jiachen Yang Date: Mon, 13 Apr 2015 01:05:57 +0900 Subject: [PATCH 1/2] 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 From 18a18ca22b7970d196f632e7caa953f6154e38ea Mon Sep 17 00:00:00 2001 From: Jiachen Yang Date: Mon, 13 Apr 2015 01:42:33 +0900 Subject: [PATCH 2/2] add fullwidth CJK chars --- src/backend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend.py b/src/backend.py index 9b071426..bc2d2d41 100755 --- a/src/backend.py +++ b/src/backend.py @@ -459,7 +459,7 @@ class Backend(): i += 1 if not UCS.isCombining(c): rc += 1 - if unicodedata.east_asian_width(c) in ('W', 'A'): + if unicodedata.east_asian_width(c) in ('F', 'W', 'A'): rc += 1 return rc