emacs-devel
[Top][All Lists]
Advanced

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

Re: Ligature support


From: Eli Zaretskii
Subject: Re: Ligature support
Date: Fri, 05 Nov 2021 21:11:57 +0200

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: emacs-devel@gnu.org
> Date: Fri, 05 Nov 2021 17:45:09 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > For example, the mode line can show stuff like "=-", and the font
> > could have a ligature for that -- do we really want that ligature on
> > the mode line?
> 
> That's a good point.  On the other hand, perhaps we want to use a
> different font on the mode line when using one of these special fonts.

It doesn't matter, because composition-function-table is currently
global and doesn't depend on the font.

> > Or the font could have a ligature for "ffi" -- do we want a variable
> > named "efficient" be displayed with that ligature?  I'd be surprised.
> 
> Possibly, but probably not.  But I don't think people will choose to use
> fonts for programming that have fonts like that.

Oh yes, they do.

> (Are there even any monospace fonts that have such ligatures?)

Yes, definitely.

> > Displaying them is easy, just set up composition-function-table
> > accordingly (I can show you the code if you cannot figure that out).
> 
> Yes, please -- I've been poking at that, but didn't find the right
> incantation.

The following should display the ligatures starting with 'f' if the
font supports them:

  (aset composition-function-table
        ?f
        '(["f[fhijlt]" 0 font-shape-gstring]))

> Well, it's one problem, and I think it's the one that has to be solved
> first.

See above: there's no problem here that isn't already solved.

> For instance, see bug#51385 where they have a weirdo font that maps
> "[TRACE]" (and 260 other strings) to different glyphs.  We need that
> list, because we certainly don't want to be passing "[TRACE]" to
> harfbuzz when not using that font.

I think we rather need to have a (minor) mode which uses those, and
under that mode we do want to pass these strings to HarfBuzz.  If the
default font doesn't support the corresponding ligatures, we display
the literal strings.  It is then up to the user to install the right
font and tell Emacs to use it (via some face, I guess).



reply via email to

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