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: Mon, 18 May 2020 19:08:45 +0300 Message-ID: <83367x9qeq.fsf@gnu.org> References: <20200517124125.000013a4@web.de> <97C7EAB7-10AB-4702-ABC8-EB6C1C50ABDB@gnu.org> <20200517165953.000044d2@web.de> <83lflqblp0.fsf@gnu.org> <83ftbybio3.fsf@gnu.org> <83zha69xs2.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="49684"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: pipcet@gmail.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 18 18:10:13 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 1jaiLD-000Cmh-SM for ged-emacs-devel@m.gmane-mx.org; Mon, 18 May 2020 18:10:11 +0200 Original-Received: from localhost ([::1]:47118 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaiLC-0008CP-Tj for ged-emacs-devel@m.gmane-mx.org; Mon, 18 May 2020 12:10:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaiK3-0006Ja-OQ for emacs-devel@gnu.org; Mon, 18 May 2020 12:08:59 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:59803) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaiK3-0005Vr-CU; Mon, 18 May 2020 12:08:59 -0400 Original-Received: from [176.228.60.248] (port=2278 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jaiJv-000654-Aa; Mon, 18 May 2020 12:08:58 -0400 In-Reply-To: <83zha69xs2.fsf@gnu.org> (message from Eli Zaretskii on Sun, 17 May 2020 22:17:17 +0300) 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:250768 Archived-At: > Date: Sun, 17 May 2020 22:17:17 +0300 > From: Eli Zaretskii > Cc: emacs-devel@gnu.org, julius.pfrommer@web.de > > > LibreOffice highlights sub-glyphs of ligatures correctly. I enter > > "official", and it renders . I move the > > cursor right twice, and it highlights precisely what it should, the > > middle "f" of the ligature glyph. > > We can do that in Emacs as well. The information is there, we just > need to use it. For Latin ligatures that information will allow the > display you describe. Doing that for other scripts would be harder, > and the results will be less one-to-one. On second thought, I think I misunderstood you. If the font that is used shows "ffi" as a _single_ glyph ffi, and LibreOffice indeed highlights parts of this glyph, then I'd like to know how it does that, and how far does this capability extend. I mean, what does it do with ligatures like ae, displayed as æ -- does it highlight the common vertical stroke for both parts? And what about "st", displayed as st -- this has a curved "hand" connecting s and t -- to which of the 2 does it belong for the purposes of highlighting? There's also "hv" displayed as ƕ, let alone "fs" displayed as ẞ and "fz" displayed as ß. IOW, I really don't think I understand how this could work even for what you call "English ligatures". Do you know how they do it? The information I said we get from HarfBuzz is returned when HarfBuzz produces a grapheme cluster from several font glyphs. When the result is a single font glyph, that information just says which of the original codepoints are to be displayed as that single glyph, it doesn't provide any sub-glyph information.