[Top][All Lists]

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

Re: Ligature support

From: Eli Zaretskii
Subject: Re: Ligature support
Date: Sat, 06 Nov 2021 11:49:37 +0200

> Date: Sat, 6 Nov 2021 10:16:25 +0100
> From: tomas@tuxteam.de
> Cc: emacs-devel@gnu.org
> > > > We do pass the language to HarfBuzz when we think we know it, but the
> > > > problem is Emacs itself has no good notion of the "current language".
> > > 
> > > This is what I was pointing at.
> > 
> > Well, don't just point to the obvious: better sit down and code some
> > features that we can use to be smarter ;-)
> > 
> > > If the text itself is multilingual, your best bet is to ask the user
> > 
> > Asking the user during redisplay is a non-starter.
> [...]
> In short, there are languages where "asking the user" is just the
> only option; that means that the feature only makes sense while
> typesetting (where you /can/ ask the user) and not while rendering
> dynamically (the "redisplay" case we are treating here).

I thought you were suggesting to ask the user about the language
pertinent to a particular chunk of text.

Regarding ligatures in general: of course, the user should be able to
say whether the ligatures are wanted, and be able to select which of
the ligatures are and which aren't.  The issue at hand was that
ligatures are language sensitive, and we don't have a good notion of
the language of the text.

> > > and your second-best bet is to do some statistical heuristics, which
> > > only will "work" for a longer stretch of text.
> > 
> > That's a waste of CPU cycles: when we don't know the language, we ask
> > HarfBuzz to guess, and I trust HarfBuzz that it can guess as well or
> > better as we can.
> I haven't looked into it, but I wonder what magic it uses, if it
> isn't some variation of "maximum likelihood over n-gram statistics".

Nothing of the kind, AFAIU: it just looks at the script of the

But it sounds strange to me to have Emacs use n-gram statistics during
display.  We should collect the relevant data from other sources.

reply via email to

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