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 (was: Entering emojis) Date: Fri, 05 Nov 2021 09:56:48 +0200 Message-ID: <83cznfdohr.fsf@gnu.org> References: <87cznths5j.fsf@gnus.org> <835ytiuvm9.fsf@gnu.org> <834k91vgie.fsf@gnu.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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4385"; 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 08:58:22 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 1miu7B-0000yY-K3 for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Nov 2021 08:58:21 +0100 Original-Received: from localhost ([::1]:49896 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1miu7A-0007I5-59 for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Nov 2021 03:58:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1miu65-0006WI-1F for emacs-devel@gnu.org; Fri, 05 Nov 2021 03:57:13 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:44698) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1miu63-0006kY-3U; Fri, 05 Nov 2021 03:57:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=gYHSxsM5OvEr5bFp0EySzTI0nPpu5w7Ep1f0FbVuLPY=; b=TB2xnYgk1QP/iH7+MwB3 DXcjYiCJ7z4yTYaqyEJTqAzLV5g+Yce9O1Iqe93/y13i1yI33IYNs1fRsMlHvmHpCVDH20ursV1yH 27EtRJTJmIpCS1uUwyremcFEjuamVd1jRedPY2YChjT2d4v/LCXzWnHALhvzTvmrnUJodj/LXg3vq HYRWjGiti3ZzapNaX1evPuNcdHg2Tm7gCV+m207v1U94XufiDypgaJgZUaHWeMoz75St/18taOggB UtGPtprcjeLBqDJwn8PiEpTj00MexPmzz/vsE5R/Aq3tvqsC6ie0OxdMw70q+6XC95wwJED/r+lMl iw4e3K8cWlqCEA==; Original-Received: from [87.69.77.57] (port=1465 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 1miu62-0000uJ-Jw; Fri, 05 Nov 2021 03:57:10 -0400 In-Reply-To: <87wnlnkxbo.fsf@gnus.org> (message from Lars Ingebrigtsen on Fri, 05 Nov 2021 06:04:11 +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:278744 Archived-At: [I've changed the Subject, because the original thread is unrelated, and it's too long already.] > 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 06:04:11 +0100 > > So apparently by traversing the GSUB/GPOS tables (whatever they are), > this data can be found, and then we can feed it to font-shape-gstring > and get ligatures? You are describing what the text shaper does when it looks for possible ligatures. Why should we reproduce this in Emacs? It's the job of the shaping engine to understand how to query a font for some information. Delegating that job to the shaping engine is TRT, so that we don't need to make changes in Emacs when some new variant of font appears in the wild. And I'm not sure I understand the idea behind this. Are you trying to add a feature to Emacs whereby it queries the font up from about the ligatures it supports? What would we do with such an information? And for which font(s) would we request it? We have font-shape-gstring. If the font being used doesn't have a ligature for the character sequence we pass to it, that function returns nil, and we then display those characters "normally". Isn't that enough? > But apparently we already parse these tables in hbfont_otf_capability? Only for script and language information, because some scripts require fonts that support special features of those scripts, and so our default fontset requires the presence of those features in the font; those features are queried when we determine whether some font can be used for a character from those scripts. > So... we need... to parse them more to get all the ligature data out > of them and then... put it in a ... char table range? How all this > connects is very vague to me. 😀 As I say above, I'm not sure I understand the goal of this, given what we have already.