[Top][All Lists]

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

Re: Ligature support

From: Lars Ingebrigtsen
Subject: Re: Ligature support
Date: Fri, 05 Nov 2021 16:20:19 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

> Why do we need to depend on the font?  As I said, if the font doesn't
> have a ligature, font-shape-gstring will return nil, and we will then
> display the characters as individual glyphs.  Isn't that what is
> expected?

Different fonts have different ligatures (or "ligatures").  Since we
don't want to send all strings through font-shape-gstring (because
that'll be slow), we'll have to be selective as usual, I think?

For instance, my test font has these ligatures:

          <LigatureSet glyph="numbersign">
            <Ligature components="zero,one" glyph="end1.swsh"/>
            <Ligature components="zero,two" glyph="end2.swsh"/>
            <Ligature components="zero,three" glyph="end3.swsh"/>

I.e. "#01" is translated into a very different glyph, and we need to
know that so that we can send "#01" to harfbuzz to get the glyph out.
(This is how all the "neat" programming fonts that translate => into fun
glyphs work.)

This data is in the GPOS table, and I just found this fun utility:

ttx -t GPOS ~/.fonts/Jolie\ Romantique.ttf

I'll have a peek at the source code to see how much work it is to
extract this data.

(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

reply via email to

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