[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#64420: string-width of … is 2 in CJK environments
From: |
Eli Zaretskii |
Subject: |
bug#64420: string-width of … is 2 in CJK environments |
Date: |
Sun, 02 Jul 2023 16:10:03 +0300 |
> Date: Sun, 2 Jul 2023 15:57:07 +0300
> From: Dmitry Gutov <dmitry@gutov.dev>
>
> Hi! This was reported to company-mode
> (https://github.com/company-mode/company-mode/issues/1388), as a
> scenario that makes the overlay-based completion popup misrender because
> the columns are not computed right when that char is present.
>
> To repro:
>
> (set-language-environment "Chinese-BIG5")
> (string-width "…") ;; => 2
>
> In the default language environment its width is reported to be 1.
>
> This doesn't seem to make sense because it's rendered one column wide
> either way.
On GUI frames Lisp programs that need to know the actual width of some
string should use string-pixel-width, not string-width. The latter is
basically only for TTY frames.
(progn
(set-language-environment "Chinese-BIG5")
(ceiling (/ (string-pixel-width "…")
(float (default-font-width))))) ;; => 1
- bug#64420: string-width of … is 2 in CJK environments, Dmitry Gutov, 2023/07/02
- bug#64420: string-width of … is 2 in CJK environments,
Eli Zaretskii <=
- bug#64420: string-width of … is 2 in CJK environments, Dmitry Gutov, 2023/07/02
- bug#64420: string-width of … is 2 in CJK environments, Eli Zaretskii, 2023/07/02
- bug#64420: string-width of … is 2 in CJK environments, Dmitry Gutov, 2023/07/06
- bug#64420: string-width of … is 2 in CJK environments, Eli Zaretskii, 2023/07/07
- bug#64420: string-width of … is 2 in CJK environments, Dmitry Gutov, 2023/07/10
- bug#64420: string-width of … is 2 in CJK environments, Eli Zaretskii, 2023/07/11
- bug#64420: string-width of … is 2 in CJK environments, Dmitry Gutov, 2023/07/10
- bug#64420: string-width of … is 2 in CJK environments, Eli Zaretskii, 2023/07/11
- bug#64420: string-width of … is 2 in CJK environments, Dmitry Gutov, 2023/07/11
- bug#64420: string-width of … is 2 in CJK environments, Eli Zaretskii, 2023/07/11