GNU bug report logs -
#38485
Customizing glyph widths
Previous Next
Full log
Message #8 received at 38485 <at> debbugs.gnu.org (full text, mbox):
> From: Clément Pit-Claudel <cpitclaudel <at> gmail.com>
> Date: Tue, 3 Dec 2019 23:22:35 -0500
>
> Interestingly, both of these cases are handled quite nicely in emacs -nw, because there the display is purely grid-like.
FTR, I'd like to clarify that Emacs doesn't "handle" the -nw case in
any way, it's taken care for us of by the terminal itself. Assuming
that the terminal has the same notion of character width as Emacs
does, that is; if they use different tables, the characters will not
align.
> For my use case, it would be enough to have this available as a minor mode, but Yuan Fu mentioned the following on emacs-devel: "I’d like to see it as a face attribute instead of a mode. (Because I want to align my org table). Maybe there could be a face attribute (:grid WIDTH) that instructs the display engine to pad each glyph to have width that is a multiple of WIDTH in pixel, and if WIDTH is t, default to “base character width”? I remembered that ‘window-width’ gives width in char widths and had a look at its source. It knows the character width from FRAME_COLUMN_WIDTH; the comment says the value currently equals to the average width of the default font of the frame. I think this value can be used as the “base character width”."
I don't think I understand the rationale for using a face. It sounds
like a subset of the general case, and why would someone want this
alignment only for one special face?
Using a face also means that the same characters from a larger font
will not be aligned.
> Now that I think of it, though, I could see the use for a text property. For example, prettify-symbols-mode could have an option to make each n-characters prettification n-characters wide, so that composing ~~> into ⟿ would produce a wide arrow occupying the exact same amount of space as the original uncomposed characters.
So what kind of text property would that be, and where and how will it
come into play in the above scenario?
Thanks.
This bug report was last modified 5 years and 196 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.