[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 23:38:12 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

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

Yes, and I think that has to change.  (Probably.)

> 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]))

Thanks!  That was both easier and less expressive than I thought, in a
way...  With my fancy test font.  Before:

PNG image


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

PNG image

Heh; there's some glitches here -- the leftmost swoosh is so extensive
that it doesn't paint it correctly, and:

PNG image

Entering some spaces at the start doesn't clear up all the artefacts.

>> 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).

Yes and no.  There's no limit to the number of these strings that fonts
support, so if this hypothetical minor mode were to "list them all",
it'd basically be the same as running all text through harfbuzz.  Which
we don't want to do in general.  Ergo the need to have a per-font
ligature table.

(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]