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: Yuan Fu
Subject: Re: Display certain glyphs with paddings on the side
Date: Tue, 3 Dec 2019 20:22:59 -0500


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/).


Clément expressed the idea better than I could have. However, 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”.

Yuan


reply via email to

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