From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.devel Subject: Re: Ligatures (was: Unify the Platforms: Cairo+FreeType+Harfbuzz Everywhere (except TTY)) Date: Fri, 22 May 2020 09:34:54 +0000 Message-ID: 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> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="1351"; mail-complaints-to="usenet@ciao.gmane.io" Cc: cpitclaudel@gmail.com, alan@idiocy.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri May 22 11:36:19 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 1jc46E-0000Gr-Us for ged-emacs-devel@m.gmane-mx.org; Fri, 22 May 2020 11:36:18 +0200 Original-Received: from localhost ([::1]:33946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jc46E-0003LA-1O for ged-emacs-devel@m.gmane-mx.org; Fri, 22 May 2020 05:36:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52798) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jc45W-0001yA-Vc for emacs-devel@gnu.org; Fri, 22 May 2020 05:35:35 -0400 Original-Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]:43430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jc45V-0005Ha-4w; Fri, 22 May 2020 05:35:33 -0400 Original-Received: by mail-ot1-x341.google.com with SMTP id a68so7748865otb.10; Fri, 22 May 2020 02:35:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UIvGmcBiHCpi4o1nx2Qch5F9K9bCuwnhvGdZbHkd2sI=; b=CdR3pXNWU3slHVXJC4c1GSpnKZ8Qk8HZzmxehAuRBqAnWeydZ/ff8TixxXdTb7VWW6 ztiH+IZf2gt/g3MnfIEgHeVipCjrCYLDJ4+lQUrnlyNH0xfTQUi8acGoZvMQqQijyAEX 9IfrgtBW90yZhT8pkSdYCd1CPdDlsiJxXP3+P9ZSIb9wtLq+GjAC0B+H4dZ0sZF5DLe0 Z3kHF2iJC9+BhZ8Uyg25DdgDZnL81ZsGbBbDgYHHMf1WiIextCyB9bf/EqI51/+DHqsD clQTVsCfe6kBVOcWkSL06RJ+iyb/6sFWQJ7wvXDB5sT6UqSFO892ZhPHSfSUnUqh7nb1 3Dsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UIvGmcBiHCpi4o1nx2Qch5F9K9bCuwnhvGdZbHkd2sI=; b=RXtCBp1yKjU010RlhMjM+ACa8uU3aTUWHFrgHBtOVTWPP+wHBdKZtWK0i/Tj/2xJsv gIFfk1FELU6k+Ev6nBnq6j7YLXzNVBPvUDnLj6BCZum26WPByNYiDizPV35W24Jxx3DH 1ggd/37Rqzf1M9+SwLV/xapKjH+NRg8bJsk5/SabRPhHZpDAl8gUmvpft6moXwmTYfBG xjbz7x8e17TLPsBPzOUl+99pSmhaLFtm6wYZrTBeTGTsrBTU16Z8jg1rw+3R6/Rk4i+/ XSiUiLPYa2Vfoh6Y4jCJxHwmaaMY6If9XygCUxx+PZseOyrJS66g1k62a58DR4vOGkSn hptA== X-Gm-Message-State: AOAM533mV6GzJrPGzC+rZCG2FSt6q5+FBnrZYRTL/ZzKRDKKilVXUMa4 RX1Y9meJmTpQeT+tJVhkxaMsB659rWcPdwIKmKLpqHIH X-Google-Smtp-Source: ABdhPJwBJjtHOpWguE8AsXvEzN8kytmYcT/csupGGMF6xQZeK0b+5OVzW8e7RY+QO5w8M/iYxmaBPBeBOPc1+wsmRFY= X-Received: by 2002:a9d:7a50:: with SMTP id z16mr10945389otm.292.1590140131208; Fri, 22 May 2020 02:35:31 -0700 (PDT) In-Reply-To: <83y2pk4i7r.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::341; envelope-from=pipcet@gmail.com; helo=mail-ot1-x341.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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:251206 Archived-At: On Fri, May 22, 2020 at 6:06 AM Eli Zaretskii wrote: > > From: Pip Cet > > Date: Thu, 21 May 2020 21:06:27 +0000 > > Cc: cpitclaudel@gmail.com, alan@idiocy.org, emacs-devel@gnu.org > > > > > 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.