[Top][All Lists]

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

Re: Variable pitch text filling

From: Lars Ingebrigtsen
Subject: Re: Variable pitch text filling
Date: Sat, 27 Nov 2021 09:04:53 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> That'd probably be more efficient, but some cursory testing seems to
>> indicate that putting a min-width on every char in a pretty big buffer
>> works fine.
> I don't like such an implementation.  It's a kludge at best, IMO.
> Please let's not go that way.

Yes, I was pondering other solutions for several different, but somewhat
related, use cases.

1) We want to display the "-" wider in the variable-pitch mode line
2) In the justification case, we want to add some blank pixels more free-form
3) A much-requested feature is to be able to "snap" characters to an
integer multiple of the standard font (in a fixed-width buffer).
(Mostly relevant for people that mix fonts, like CJK and roman.)

All three of these are essentially the same: Add some pixels to the
glyphs in a region.

So we could do just that.  I.e., not a complex display spec, but a
simpler char-based one, for instance `char-spacing', that could have

1) 1.0, to be at least 1 normal character wide
2) 3, to add three blank pixels to the end
3) `grid', to add enough blank pixels to have a width that's an
   integer multiple of the normal character width

So standard-mode-line-format would have

              (list ""
              'display '(min-width (5.0))
              'char-spacing 1.0)

while inter-character justification would use 'char-spacing 1 to add an
extra pixel after all the chars on the line, for instance. 

(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

reply via email to

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