emacs-devel
[Top][All Lists]
Advanced

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

Re: Unicode combining characters


From: Clément Pit-Claudel
Subject: Re: Unicode combining characters
Date: Tue, 25 May 2021 15:30:21 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

On 5/25/21 2:39 PM, Eli Zaretskii wrote:
>> From: Clément Pit-Claudel <cpitclaudel@gmail.com>
>> Date: Tue, 25 May 2021 14:15:33 -0400
>>
>> On 5/25/21 1:24 PM, Eli Zaretskii wrote:
>>>> From: Anand Tamariya <atamariya@gmail.com>
>>>> Date: Tue, 25 May 2021 21:26:44 +0530
>>>>
>>>> Hindi Devanagari script has lot of unicode combining characters which 
>>>> results in misalignment in a
>>>> rectangular overlay for constant number of characters (screenshot ) 
>>>> What would be a recommended way to tackle this in Emacs?
>>>
>>> Use align-to 'space' display spec and/or the window-text-pixel-size
>>> function, which will account for the actual size of the text on
>>> display. 
>>
>> Will this work? The misaligned specs are already part of a replacing 
>> dipsplay spec, so the additional align-to would be ignored, no?
> 
> I don't understand, but maybe you know about the particular use case
> more than I do.  I just mentioned two devices that can be accurate to
> 1 pixel wrt to the X coordinate.
> 
>> (IIRC, there is no way to say "replace this text by this string followed by 
>> this specified space; it's one or the other, right?)
> 
> Again, I don't think I follow.  If you have "this text", you can
> calculate its width on display, and then know how many pixels of white
> space you will need after "this string" replaces that text.  So,
> unless I'm missing something, specifying the space width is redundant,
> and actually makes a solvable problem unsolvable.

Based on the screenshot this is an issue with Company.  Company displays its 
"pop-ups" by putting a replacing 'display property on the text following the 
point (and on the next few lines).  So if the buffer contains

ABC XYZ DEF GHI
JKL MNO PQR STU

and the point is after XYZ, then company puts a replacing display spec from " 
DEF" to "STU".
To display completions "XYZ1233" and "XYZ456", the replacing display spec 
contains "123| GHI\nJKL XYZ456| STU", so the final display is

ABC XYZ123| GHI
JKL XYZ456| STU

The OP's issue is that "123" and "456" don't have the same length.  As far as I 
know, there is no way to add extra space after 123 or 456 so that they reach 
the same X coordinate, given that they are already part of a display spec.

Clément.



reply via email to

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