emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unicode combining characters


From: Eli Zaretskii
Subject: Re: Unicode combining characters
Date: Thu, 27 May 2021 12:40:45 +0300

> From: Anand Tamariya <atamariya@gmail.com>
> Date: Thu, 27 May 2021 12:30:04 +0530
> Cc: emacs-devel@gnu.org
> 
>  Please try the latest master branch, I hope I fixed this now.
> 
> The fix works for the given example. However, here's another one that ideally 
> should be one composed glyph
> (validated by moving the cursor over the glyph) but counts as 2 in 
> string-width.
> 
> (setq ra (string 2352 2366))
> 
> (string-width ra) ; 2

OK, I improved this case now on master, please take a look.

However, please note that getting this right makes string-width more
dependent on the selected-frame's font used by the default face for
the characters of the string.  In particular, if that font is unable
to combine the characters that should be composed, you will now get
width which could be different from the value on other frames with
other fonts.  Also, the new code only works in interactive sessions on
GUI frames, because we need the shaping engine (a.k.a. "font driver")
to compose characters.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]