emacs-devel
[Top][All Lists]
Advanced

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

Re: Variable pitch text filling


From: Eli Zaretskii
Subject: Re: Variable pitch text filling
Date: Fri, 03 Dec 2021 21:38:08 +0200

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: casouri@gmail.com,  tumashu@163.com,  emacs-devel@gnu.org
> Date: Fri, 03 Dec 2021 16:41:35 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > This is one of the "TIL" situations each one of us has with Emacs from
> > time to time.  It means my thinking about adding character spacing was
> > based on wrong assumptions, and the only way to do that is to add
> > stretch glyphs (which can be done only between words).
> 
> Why can stretch glyphs only be added between words?  Is it because we
> ask the font backend to draw a series of glyphs in one go?

Yes.  A series of glyphs of the same type (character glyphs, stretch
glyphs, composition glyphs, etc.) are collected into a "glyph string"
and drawn by the backend in one go.

> If that's the case, perhaps we could stop doing that if we're doing a
> gridded display?

That'd be much slower, I guess?  For each such separate glyph we need
first clear the background with the color of the face, then draw the
glyph itself.  Right now, we clear the background for all of the
glyphs in one GUI call, then write all of the glyphs in a single call
to the font driver.

> One other thing that occurred to me (but I didn't look at closely) is
> whether it would be feasible to work on the glyph matrix for a line
> after it's been composed.  I remember you doing some work on that when
> we talked about "compressing the mode line" -- I think you basically
> went over the matrix and removed some of the space glyphs?  (That
> approach didn't work for other reasons, but the basic post processing
> thing did work, I think?)

That'd cause the same problem as above: each character glyph will be
drawn separately, because the stretch glyphs in-between them will
break the sequence of character glyphs into individual characters.

> Do we have enough info about the glyphs at that stage that we could add
> some stretch glyphs to gridify the line?

Yes, information is not the problem.



reply via email to

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