From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.devel Subject: Re: master bf0aeaa0d7a: Re-enable displaying `han' characters on Android Date: Fri, 09 Aug 2024 12:33:37 +0000 Message-ID: <87ed6xswo2.fsf@protonmail.com> References: <86h6c5y39e.fsf@gnu.org> <871q36x8pi.fsf@protonmail.com> <87wmkyosr5.fsf@yahoo.com> <87wmkxwxzu.fsf@protonmail.com> <87plqppwan.fsf@yahoo.com> <87o769wue4.fsf@protonmail.com> <878qx8te33.fsf@protonmail.com> <87y157naca.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8065"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Benjamin Riefenstahl , Eli Zaretskii , emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Aug 09 15:35:35 2024 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 1scPmI-0001vo-RM for ged-emacs-devel@m.gmane-mx.org; Fri, 09 Aug 2024 15:35:34 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1scPle-0000Lq-To; Fri, 09 Aug 2024 09:34:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1scOoX-0003Dg-0Y for emacs-devel@gnu.org; Fri, 09 Aug 2024 08:33:49 -0400 Original-Received: from mail-4316.protonmail.ch ([185.70.43.16]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1scOoU-00026Q-3a; Fri, 09 Aug 2024 08:33:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1723206823; x=1723466023; bh=kMWN53JTrb3f2eNI7Hxa/72Mh/PLIMXNjLDXeHfagYk=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=ez4MfrnxvbYqKNV7wuxpMzBzLOo/dId9tzgqz8WORQtCq0vCZfazQVnkm4/eioNV5 Tb3sKbPWNmHV22EpuMXrSXDB9b0w66J55C2sp7qSrUuO9ocGm8Z7+nun+92x4T8FAh X5R3HcpsPCtqLpS4C1fhLsMVZ7gmDDIxMsGRp0iUZGTgogbenmECVS30KXMERH4A5S n3TO/nPb29/aRQQzJS6Fc4y4tPTw01i57D5I3ewkgHkdIPcGcdvAzMWvdBHYVDIOaA KaUlJ5TZzVvdTPgNA+NwKGuphAMYYckSMLh41Hiac2XuFgYPHsj7AHdCOLa7PnjblF JXoFmb2cFLVKA== In-Reply-To: <87y157naca.fsf@yahoo.com> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 5e670f32cf2137ee91ac62bf41e6a7850c46aecf Received-SPF: pass client-ip=185.70.43.16; envelope-from=pipcet@protonmail.com; helo=mail-4316.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 09 Aug 2024 09:34:54 -0400 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:322572 Archived-At: "Po Lu" writes: > Pip Cet writes: > >> Just so that we have that option, I've done the minimal work necessary >> to build Emacs for Android with fontconfig and the ftcrhb and ftcr font >> drivers. As far as I can tell, it works now (including, regrettably, >> color emoji provided in font files). Harfbuzz shaping seems to work, >> too. I still have to look at what the DRAW_CURSOR stuff does... >> >> Of course there are good reasons not to want to do this: the >> sfntfont-android driver is very fast, this is not. It also requires an >> additional file to configure fontconfig and a cache directory for >> fontconfig's disk-based cache. Plus there are the extra dependencies... >> >> Obviously, this would be and remain an optional feature, with the other >> font drivers still available (that's not true for my test builds >> including these and quite a few other changes, which currently disable >> the android-specific drivers: https://codeberg.org/pipcet/emacs-android = ) > > Thanks, but I won't agree to install this No problem at all. Thanks for your response. > the invariable rule is that > people, for foolish reasons, will begin to use this font driver, with > all their flaws and imperfections, and we will ultimately be held > responsible for its upkeep. What is truly irritating is that FreeType > is part of the OS, but that it is not stable, and that the linker is > rigged not to permit third-party programs from linking to such unstable > libraries. If not for this, I could have agreed to a version of the > ftfont driver disentangled from Fontconfig. I think the decision to rely on fontconfig for the ftcr(hb) drivers has been made, though. I must confess I haven't looked at sfnt.c very much, but I'm surprised to find it has been made part of Emacs. Since it has, though, we might as well use it. And it seems Noto is working on replacing the CJK fonts by TrueType fonts. >> Which devices in the androidfont.c driver currently used on? Very old >> ones with 15/16 bpp? > > No, on non-standard operating systems where /system/fonts does not > exist. Bit depth is no object, since the OS always provides Emacs with > a 32-bit "RGBA" (which is ABGR on little-endian systems) surface on > which to draw, and handles conversion between this format and that of > the screen. Thanks! >> How do we know? I can't find this alleged source form for the Noto CJK >> font anywhere, just binaries produced by Google. Maybe they are editing >> one of the versions directly, and generating the other one from it, >> which would probably mean the secondary version is degraded in quality, >> but even then Google would have to make available instructions for how >> to build one from the other in order for the font to be considered >> free (or, if I understand the OSI definition correctly, "open source") > > Noto CJK is a version of Source Han Sans: Thanks, I'm aware it's a modified version of that font. > https://github.com/adobe-fonts/source-han-sans > and its binaries are generated from the same source code by ADFKO > (though I am surprised to learn that this source is not in UFO format). I don't think it's the "source" at all. It's an intermediate binary, produced by a proprietary tool (as Adobe states), probably from a similarly proprietary, actual source format. Anyway, as for technical issues, the Type 1 font in the Source Han Sans CID is clearly closer to the source than the TrueType fonts are. Thus, there is some quality degradation when I, or when Google, generates a TrueType font from it. Pip