From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Ligature support Date: Fri, 05 Nov 2021 17:14:31 +0200 Message-ID: <83tugqd488.fsf@gnu.org> References: <87cznths5j.fsf@gnus.org> <8ff3b131c5fa370d9eaf@heytings.org> <83mtmttsxz.fsf@gnu.org> <8ff3b131c56b7b2d1d6f@heytings.org> <83bl39tqnl.fsf@gnu.org> <8ff3b131c531f5254799@heytings.org> <83a6ittp5r.fsf@gnu.org> <8ff3b131c53b9df49236@heytings.org> <834k91th5c.fsf@gnu.org> <8ff3b131c5fe09753ca0@heytings.org> <83mtmtru6l.fsf@gnu.org> <8ff3b131c57f741d04e5@heytings.org> <83lf2drqx6.fsf@gnu.org> <87lf2c3k0z.fsf@gnus.org> <83wnlwqocq.fsf@gnu.org> <87wnlwyox9.fsf@gnus.org> <83lf2cq7n5.fsf@gnu.org> <87wnlnkxbo.fsf@gnus.org> <83cznfdohr.fsf@gnu.org> <87zgqik9bk.fsf@gnus.org> <83v916d64z.fsf@gnu.org> <878ry2k6qz.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15824"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mattiase@acm.org, raman@google.com, gregory@heytings.org, schwab@linux-m68k.org, stefankangas@gmail.com, emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 05 16:15:45 2021 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 1mj0wT-0003r6-AL for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Nov 2021 16:15:45 +0100 Original-Received: from localhost ([::1]:58462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mj0wR-0003U0-9j for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Nov 2021 11:15:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mj0vd-0002my-D9 for emacs-devel@gnu.org; Fri, 05 Nov 2021 11:14:53 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:55016) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mj0va-00024Q-DI; Fri, 05 Nov 2021 11:14:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=l3xlsq09N7qyn0dIEmEQHJLJHnZ3Y7ioStZnAtaw4IA=; b=a+jiRmZN9N18 yNa+0dERt3PP76XFwcAza7EDLe+dea4e1ssf1q0VYuzLnXe25JjBSNG1INinj/kRTqq/frAl08LPv uyaZF1AkHGal9uJf6d05MkfpwaW6HSTvRAu7pbUpeNoEhHrbbqOS8H1QrXecOwnWZwfaZXgO1ncja /r2fTPfQOrh8ZEvrJNoz0UCt7cdnZ063pO36e/SzM9r0Lwmnf3YMH9mJ3FV8kxTGfCo4JVK8l5zgX Wcslg0h0bu8dVDkcZOr97VCrSfCAncSVLfxceTidwHX+ASrgqh4MK98gHwY4Z9U010YCd8QaEwe70 iixxIX8SGsnOu0Nr2vccRw==; Original-Received: from [87.69.77.57] (port=4369 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mj0vZ-0002BM-Us; Fri, 05 Nov 2021 11:14:50 -0400 In-Reply-To: <878ry2k6qz.fsf@gnus.org> (message from Lars Ingebrigtsen on Fri, 05 Nov 2021 15:38:12 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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:278775 Archived-At: > From: Lars Ingebrigtsen > Cc: gregory@heytings.org, mattiase@acm.org, emacs-devel@gnu.org, > schwab@linux-m68k.org, stefankangas@gmail.com, raman@google.com > Date: Fri, 05 Nov 2021 15:38:12 +0100 > > Eli Zaretskii writes: > > > So for having ligatures you need to set up composition-function-table > > for the characters that could/should ligate. > > Yes. And to do that, we can parse the tables in the font, apparently. > It's not obviously clear how, but it looks like harfbuzz has the > functions needed. Why do we need to depend on the font? As I said, if the font doesn't have a ligature, font-shape-gstring will return nil, and we will then display the characters as individual glyphs. Isn't that what is expected? > > But please read the TODO item: there are pitfalls here that we need to > > solve before this could be considered a reasonable user-level > > feature. Setting up composition-function-table to produce ligatures > > for, say, "fi" and "ff" is easy for testing, but if you do that in > > production, every word with these characters, everywhere on display in > > Emacs, will display as that ligature, and that is hardly TRT. We need > > to make this more fine-tunable. TODO has the details. > > I guess it needs some more customisation to be a per-font thing? I'm not sure it's per font. I think it should be per buffer/mode, and perhaps also something special for the mode line. > But first we need to parse the Gsub/Gpos tables so that we can get > started at all. I don't think we should or need to do that. See above.