[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: Fri, 05 Nov 2021 22:30:47 +0200

> Date: Fri, 5 Nov 2021 20:52:45 +0100
> From: tomas@tuxteam.de
> Cc: emacs-devel@gnu.org
> > > it would have to know (or guess?) the language it is treating.
> > 
> > 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.

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

> > Such a notion is problematic in a multilingual editor such as Emacs.
> > It is something we still need to figure out, and after that implement
> > the necessary infrastructure.  What we have now is rudimentary and
> > very insufficient.
> I think that will always be an approximation.

Maybe, maybe not.  I Hope at least sometimes we could do better.
there are various hints in the form of the encoding, the source of the
text, etc.  We just need to figure out which means we have for
gleaning the language that is not obvious from the characters
themselves (because HarfBuzz does the latter already), and provide the
features for Lisp programs and users to use them.

reply via email to

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