[Top][All Lists]

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

Re: Proportional fonts in the mode line (one month test)

From: Lars Ingebrigtsen
Subject: Re: Proportional fonts in the mode line (one month test)
Date: Wed, 24 Nov 2021 17:55:37 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Yuan Fu <casouri@gmail.com> writes:

> The only complication is that with proportional font,
> there is no nontrivial way to right-align some text: In fixed-width
> environment, you just pad enough spaces, but in proportional
> environment, you have to pad (space :align-to (- (+ right
> right-margin) (PIXEL_WIDTH))) where PIXEL_WIDTH = pixel width of the
> stuff on right.

Yes, I guess right-aligning text on the mode line is pretty hard (unless
you switch to l2r on the mode line)?

> And there is no easy way to calculate the pixel width
> of a piece of text.

There's `string-pixel-width' in Emacs 29 now, and it actually works now
(after Martin's fix yesterdayish ­čśä).

(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]