From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Ligatures (was: Unify the Platforms: Cairo+FreeType+Harfbuzz Everywhere (except TTY)) Date: Fri, 22 May 2020 14:33:08 +0300 Message-ID: <83zha02oi3.fsf@gnu.org> References: <20200517165953.000044d2@web.de> <83lflqblp0.fsf@gnu.org> <83ftbybio3.fsf@gnu.org> <83zha69xs2.fsf@gnu.org> <83367x9qeq.fsf@gnu.org> <0ccae2a4-533b-d15c-2884-c2f00b067776@gmail.com> <83wo5987mk.fsf@gnu.org> <99d4beed-88ae-b5cd-3ecb-a44325c8a1dc@gmail.com> <20200518215908.GA57594@breton.holly.idiocy.org> <83mu6481v3.fsf@gnu.org> <75a90563-51b4-d3b8-4832-fc0e2542af0d@gmail.com> <83blmi7hys.fsf@gnu.org> <837dx55qff.fsf@gnu.org> <834ks95cmz.fsf@gnu.org> <83y2pk4i7r.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="123691"; mail-complaints-to="usenet@ciao.gmane.io" Cc: cpitclaudel@gmail.com, alan@idiocy.org, emacs-devel@gnu.org To: Pip Cet Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri May 22 13:33:35 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jc5vj-000W68-55 for ged-emacs-devel@m.gmane-mx.org; Fri, 22 May 2020 13:33:35 +0200 Original-Received: from localhost ([::1]:38970 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jc5vi-0006sV-8B for ged-emacs-devel@m.gmane-mx.org; Fri, 22 May 2020 07:33:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jc5vG-0005vx-C6 for emacs-devel@gnu.org; Fri, 22 May 2020 07:33:06 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:43382) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jc5vF-0001M3-9x; Fri, 22 May 2020 07:33:05 -0400 Original-Received: from [176.228.60.248] (port=2362 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jc5vE-0008L2-BB; Fri, 22 May 2020 07:33:05 -0400 In-Reply-To: (message from Pip Cet on Fri, 22 May 2020 09:34:54 +0000) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:251210 Archived-At: > From: Pip Cet > Date: Fri, 22 May 2020 09:34:54 +0000 > Cc: cpitclaudel@gmail.com, alan@idiocy.org, emacs-devel@gnu.org > > > > 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.