emacs-devel
[Top][All Lists]
Advanced

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

Re: on helm substantial differences


From: Eli Zaretskii
Subject: Re: on helm substantial differences
Date: Sun, 22 Nov 2020 17:19:20 +0200

> From: Juri Linkov <juri@linkov.net>
> Date: Sun, 22 Nov 2020 10:36:02 +0200
> Cc: spacibba@aol.com, bugs@gnu.support, andreyk.mad@gmail.com,
>  emacs-devel@gnu.org, contovob@tcd.ie, rudalics@gmx.at,
>  monnier@iro.umontreal.ca, ghe@sdf.org, drew.adams@oracle.com
> 
> > The result of char-width can only ever be 0, 1, or 2.  On GUI frames,
> > it doesn't always return the exact value, because characters can be
> > wider than 1, but narrower than 2.  But no character should be wider
> > than 2 columns.  Which characters did you see that required the width
> > of 3 or 4?
> 
> I tried to set tab-width to 4, and the first character
> that doesn't fit to the 4-column tab stop is:
> 
> ഐ     MALAYALAM LETTER AI
> 
> But (char-width ?ഐ) returns 1.  Some examples of more 4-column wide
> characters where char-width returns 1:
> 
> ை     TAMIL VOWEL SIGN AI
> ෛ     SINHALA VOWEL SIGN KOMBU DEKA
> ꧅     JAVANESE PADA LUHUR
> 𒐫     CUNEIFORM NUMERIC SIGN NINE SHAR2

On GUI frames, this depends on the font in use.  You cannot really
rely on char-width to solve this.

> Maybe there is another function that could return the real number of
> tab columns a character takes on the screen?

There is: font-get-glyphs.  But I'd recommend to just use a TAB of a
suitable width instead of dealing with the complexity that
font-get-glyphs requires.



reply via email to

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