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 18:34:47 +0200

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: gregory@heytings.org,  mattiase@acm.org,  emacs-devel@gnu.org,
>   schwab@linux-m68k.org,  stefankangas@gmail.com,  raman@google.com
> Date: Fri, 05 Nov 2021 16:37:50 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > How many ligatures are there in the best of all fonts?  If the number
> > of the ligatures is not too large, then passing them to the shaper may
> > not be such a terrible idea.
> 
> I don't really know -- my test font has 27 ligatures, apparently, but
> some of the more fun programming fonts have at least a hundred, I think.
> And there's fonts that turn things like :warning: into its own glyph,
> using the ligature mechanism, and who knows how many of those there may
> be.

If the sequences of characters that are converted to ligatures are not
too frequent, that is still not a catastrophe.

> > So I think we should first consider which ligatures we'd like to
> > support, and whether the answer differs depending on the major mode.
> > For example, ligatures like ==> etc. are relevant to prog-mode modes,
> > but probably not to text modes.  By contrast, "ff" and "fi" are
> > relevant only to text mode, I think.
> 
> I think we want to support all ligatures the font supports (in general).

All the time? really??

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?

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.

> But as you say, we may not want to switch all the ligatures on in all
> modes -- but I'm not really sure about that, either.  If a person is
> using the Firabase font (or whatever it was called), they presumably do
> so because they want to get all the funny glyphs everywhere (that they
> use that font).

Most of them use prettify-symbols-mode or similar stuff, and that's
different from how character compositions work: you must actually put
a special text property to make that happen.  So there's is not much
for us to learn from that.

> But it's certainly possible -- having a switch to tweak which ligatures
> should be active on a per-mode/buffer basis is something we'd need to
> look at.  I think we can look at that after we actually have ligatures
> displayed at all, though.  😀

Displaying them is easy, just set up composition-function-table
accordingly (I can show you the code if you cannot figure that out).
That's the least of our problems.



reply via email to

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