GNU bug report logs - #64420
string-width of … is 2 in CJK environments

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dmitry <at> gutov.dev>

Date: Sun, 2 Jul 2023 12:58:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: itaemu <at> gmail.com, casouri <at> gmail.com, 64420 <at> debbugs.gnu.org
Subject: bug#64420: string-width of … is 2 in CJK environments
Date: Sun, 13 Aug 2023 13:48:42 +0300
On 13/08/2023 08:24, Eli Zaretskii wrote:
>> Date: Sun, 13 Aug 2023 03:22:41 +0300
>> Cc:itaemu <at> gmail.com,64420 <at> debbugs.gnu.org
>> From: Dmitry Gutov<dmitry <at> gutov.dev>
>>
>> On 11/08/2023 21:07, Yuan Fu wrote:
>>> On GUI display, the later-half of the ambiguous characters are definitely wider than one char, but they aren’t quite 2 chars wide either. But I guess it doesn’t matter too much since one should use pixel size on GUI anyway.
>> BTW, I think most double-width characters on GUI are less than 2
>> characters wide?
>>
>> So the point here would be that some "ambiguous" ones are still wider
>> than 1, I guess.
> According to Yuan, at least in his environment those characters have a
> width that is closer to 2 than to 1.  In which case using 2 would
> produce better alignment.  Of course, using string-pixel-width will
> produce an even better alignment.

In GUI, that is. But if they are displayed with width 1 in terminal, we 
better make string-width return 1 for them too.

That might be slightly worse for certain applications (like popup in 
company), but at least the basic rendering and navigation bugs in 
terminal will be fixed this way. And the new popup rendering for company 
(using string-width and spacing instructions) is close to being ready 
anyway.




This bug report was last modified 2 years and 1 day ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.