emacs-devel
[Top][All Lists]
Advanced

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

Re: Variable-width font indentation


From: Eli Zaretskii
Subject: Re: Variable-width font indentation
Date: Tue, 06 Mar 2018 18:47:43 +0200

> From: Clément Pit-Claudel <address@hidden>
> Date: Mon, 5 Mar 2018 22:36:55 -0500
> 
> * I'm not aware of a way to get a specified space whose width equals that of 
> a particular string, without measuring the string beforehand.  Is there a way?

What do you mean by "measuring the string"?  Calculating its width?

In your implementation you used 'length', which is definitely not TRT,
especially with variable-width fonts.  I think you can find something
to help you out in shr.el.  One other possibility is to use
font-get-glyphs, but I'm not sure it will help in this case.

And I still think that for programming modes, what we need is to
substitute tab-width and column by suitably computed number of pixels,
perhaps derived from the width of some character.  Other than that,
the indentation code should "just work", as long as it uses :align-to
to get to a given pixel coordinate.



reply via email to

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