emacs-devel
[Top][All Lists]
Advanced

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

Re: Ligatures (was: Unify the Platforms: Cairo+FreeType+Harfbuzz Everywh


From: Pip Cet
Subject: Re: Ligatures (was: Unify the Platforms: Cairo+FreeType+Harfbuzz Everywhere (except TTY))
Date: Fri, 22 May 2020 09:34:54 +0000

On Fri, May 22, 2020 at 6:06 AM Eli Zaretskii <address@hidden> wrote:
> > From: Pip Cet <address@hidden>
> > Date: Thu, 21 May 2020 21:06:27 +0000
> > Cc: address@hidden, address@hidden, address@hidden
> >
> > > But automatic compositions do work by calling the shaper.
> >
> > Yes, that observation is correct. What I'm doing is still very
> > different from the (semi-)automatic compositions composite.c does.
>
> For ligatures, I don't think I understand why the automatic
> compositions are not the way to go.

I don't think I've concluded they're not, though I'm strongly leaning
that way. I didn't use them in the first patch, but that's probably
easy enough to change.

(Playing around with composite.c, I noticed it's very easy to get into
an unquittable infinite loop by specifying invalid values in
composition-function-table. That should probably be fixed).

> > > That would prevent Emacs from controlling what is and what isn't
> > > composed, leaving the shaper in charge.
> >
> > Well, yes and no: the shaper is in charge, and I see absolutely
> > nothing wrong with that. You can tell the shaper not to perform
> > ligatures (or perform only some of them), or kerning, if you want to.
>
> Tell it how? by introducing new Lisp options and data structures?

Yes. A buffer option to disable ligatures/kerning would probably
suffice, because it would essentially only be used to work around
buggy fonts.

> What would those new data structures be, and how will they be
> different from composition-function-table?

> > > We currently allow Lisp to
> > > control that via composition-function-table, which provides a regexp
> > > that text around a character must match in order for the matching
> > > substring to be passed to the shaper.
> >
> > And you're suggesting that regexp be set to, say, ".+"? Because that's
> > the only way I've found of getting it to do kerning.
>
> I'm not talking about the kerning.  This discussion is about
> ligatures, AFAIU.

Oh. I understood it differently, because kerning is an important
problem to solve in order to use variable-pitch fonts for English
text.

> For ligatures, the regexp should catch the
> sequences of characters that should be ligated.

I have to know that before using auto-composition-mode? How do I work
it out? Do I have to disassemble the font and reimplement the relevant
tables?

> ".+" is definitely
> not right for ligatures, since it will significantly slow down
> redisplay

So that's another argument against auto-composition-mode: it's too
slow unless you know in advance which ligatures you want. Right?

> for no good reason.

I think "because I want the ligatures the font provides, and I don't
care to work out in advance which ones those are" is a pretty good
reason.



reply via email to

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