emacs-devel
[Top][All Lists]
Advanced

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

Re: Display certain glyphs with paddings on the side


From: Clément Pit-Claudel
Subject: Re: Display certain glyphs with paddings on the side
Date: Tue, 3 Dec 2019 15:00:19 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1

On 2019-12-03 14:13, Eli Zaretskii wrote:
>> Cc: address@hidden
>> From: Clément Pit-Claudel <address@hidden>
>> Date: Tue, 3 Dec 2019 13:43:33 -0500
>>
>>> No, character composition does nothing to the width of glyphs on
>>> display.  We take the width from the glyph metrics reported by the
>>> font.
>>
>> For the OP's purpose, I think character composition is "enough", in the 
>> sense that it can be used to display a glyphs with padding on the sides (as 
>> far as I know, composition can't be used to shrink a glyph, however).
>>
>> Concretely, I'm think of this:
>>
>>   (insert (compose-string "a" 0 1 '(?\s (br . bl) ?\s (bc . bc) ?我)))
>>
>> If I'm reading the spec correctly, this should draw the character 我 with 
>> padding on both sides to reach the width of two spaces (assuming the choice 
>> of fonts is such as 我 is narrower than two spaces to being with).
> 
> This isn't really workable in practice. 

Sorry, my point wasn't that the OP should do that; rather, I was pointing out 
that the display engine was powerful enough to achieve the desired result.

Ideally, what I'd love to have is a mode that implements a grid-like layout, 
where each character occupies an exact multiple of the base character width, 
regardless of which font it comes from.

Deciding what this multiple should be for each character could be done in 
various ways; for my purposes (and for OP's case as well, I think), it would be 
enough to use one cell for halfwidth characters, two for fullwidth characters, 
and add a few exceptions for things like TAB and zero-width spaces (I'm using 
the terms fullwidth and halfwidth in the sense of 
https://www.unicode.org/reports/tr11/).

Should I open a bug report about this?

Cheers,
Clément.



reply via email to

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