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: Eli Zaretskii
Subject: Re: Ligatures (was: Unify the Platforms: Cairo+FreeType+Harfbuzz Everywhere (except TTY))
Date: Fri, 22 May 2020 14:33:08 +0300

> From: Pip Cet <address@hidden>
> Date: Fri, 22 May 2020 09:34:54 +0000
> Cc: address@hidden, address@hidden, address@hidden
> 
> > > 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.

That option already exists: disable auto-composition-mode in a buffer
where you don't want that.

If you want to disable only some compositions, like only ligatures, or
only some of the ligatures, you can do that in two ways:

  . modify composition-function-table (although this currently cannot
    be done only for a single buffer, I think: something to fix for
    better ligature support)
  . provide your own composition function to be used in
    composition-function-table, which could then be programmed to
    decide which ligatures to allow and which not to allow

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

Perhaps so, but let's discuss the kerning issue separately.  It's a
separate problem, AFAIU.

> > 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?

I tried to answer this in my previous message in this thread.

> > ".+" 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?

It's too slow if we have too many ligatures, or, more generally, too
many characters to compose.  Character composition works by calling
Lisp (so as to allow use the flexibility we need, see the other
messages), and calling Lisp for too many characters during redisplay
will make redisplay slower.  This is one reason why we don't run every
buffer substring through the shaper, although the HarfBuzz developers
told me long ago they thought this was a flaw in our design.

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

Let's see if I succeeded to convince you that we have better
solutions.



reply via email to

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