help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: right aligning a string, using display (space :align-to


From: martianhiatus
Subject: Re: right aligning a string, using display (space :align-to
Date: Fri, 20 Oct 2023 22:05:40 +0200

(pls cc me so i can easily respond / quote)

You assume that string-pixel-width takes text-scaling into account?  I
don't think it does; you should use window-text-pixel-size or
buffer-text-pixel-size instead.  That's because text-scaling is a
buffer-local feature, and string-pixel-width is not told which buffer
you have in mind.

I'm just asking for any help i can get regarding how to right-align a string in 
a way that isn't broken by text-scaling. i don't know how to go about it.

i'm only using string-pixel-width because i thought i needed to subtract it from "right" 
in the pixel-width spec, as quoted previously. i don't see how the window or buffer functions can 
help with that that, as i'd have to subtract my string's pixel width from them, so they'd need to 
replace "right", rather than my string width calculation, it seems to me. perhaps you had 
in mind another way to use them, but didn't say.




reply via email to

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