emacs-devel
[Top][All Lists]
Advanced

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

Re: Ligature support (was: Entering emojis)


From: Eli Zaretskii
Subject: Re: Ligature support (was: Entering emojis)
Date: Fri, 05 Nov 2021 09:56:48 +0200

[I've changed the Subject, because the original thread is unrelated,
and it's too long already.]

> 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 06:04:11 +0100
> 
> So apparently by traversing the GSUB/GPOS tables (whatever they are),
> this data can be found, and then we can feed it to font-shape-gstring
> and get ligatures?

You are describing what the text shaper does when it looks for
possible ligatures.  Why should we reproduce this in Emacs?  It's the
job of the shaping engine to understand how to query a font for some
information.  Delegating that job to the shaping engine is TRT, so
that we don't need to make changes in Emacs when some new variant of
font appears in the wild.

And I'm not sure I understand the idea behind this.  Are you trying to
add a feature to Emacs whereby it queries the font up from about the
ligatures it supports?  What would we do with such an information?
And for which font(s) would we request it?

We have font-shape-gstring.  If the font being used doesn't have a
ligature for the character sequence we pass to it, that function
returns nil, and we then display those characters "normally".  Isn't
that enough?

> But apparently we already parse these tables in hbfont_otf_capability?

Only for script and language information, because some scripts require
fonts that support special features of those scripts, and so our
default fontset requires the presence of those features in the font;
those features are queried when we determine whether some font can be
used for a character from those scripts.

> So...  we need...  to parse them more to get all the ligature data out
> of them and then...  put it in a ... char table range?  How all this
> connects is very vague to me.  😀

As I say above, I'm not sure I understand the goal of this, given what
we have already.



reply via email to

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