[Top][All Lists]

[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: Fri, 09 Mar 2018 10:30:54 +0200

> Cc: address@hidden, address@hidden
> From: Clément Pit-Claudel <address@hidden>
> Date: Thu, 8 Mar 2018 14:55:20 -0500
> > Maybe we could find a middle ground, whereby each one of the examples
> > will approximately align.  If that can be done, and the result is
> > acceptable, then the problem of recording the text properties in the
> > file and/or reindenting when the file is revisited goes away.
> Maybe :)  I don't know how good it would look, in practice, but it's easy to 
> experiment.
> Paul's algorithm is not too bad in that sense: these two examples align 
> pixel-perfectly.

Yes, but as I said, I don't think that approach is appropriate for
code indentation, because leading whitespace in code blocks _must_
always align, IMO.  IOW, that approach seems to favor alignment of
multi-line code sequences to alignment of indented blocks, and I think
programming modes should have the opposite preference.

> > Is it really needed?  With most font back-ends, a tab is displayed as
> > a stretch glyph whose width is an integral multiple of the width of
> > the space glyph for the same font.  So they should align even without
> > the fixed-pitch font trick.
> Hmm, indeed.  So which problems did you have in mind when you said the 
> following?
> > But leading whitespace will certainly be aligned, something that is 
> > not universally true today.

At least the w32 font back-end doesn't fulfill that requirement,
because it calculates the font's space width differently (due to
practical problems related to the MS-Windows APIs).  Not sure about

> > That's more relevant for text-derived modes, where indentation levels
> > are rigid and not determined by previous lines.  There we could do a
> > better job, I hope.
> OK.  I tend to think of indentation even in text modes as being somewhat 
> previous-lines dependent (wrapped paragraphs align relative to bullet points, 
> for example), but I agree that it isn't as much as in programming modes.

IME, indentation of text in word processors I use does not depend on
previous lines at all.

reply via email to

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