From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: master bf0aeaa0d7a: Re-enable displaying `han' characters on Android Date: Thu, 01 Aug 2024 18:30:31 +0800 Message-ID: <87frror0vs.fsf@yahoo.com> References: <86h6c5y39e.fsf@gnu.org> <87plqtf6m0.fsf@yahoo.com> <864j84yfjh.fsf@gnu.org> <8734noslmt.fsf@yahoo.com> <86sevowp2q.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36057"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Aug 01 12:31:49 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 1sZT65-0009G4-7u for ged-emacs-devel@m.gmane-mx.org; Thu, 01 Aug 2024 12:31:49 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZT5G-0008A1-C3; Thu, 01 Aug 2024 06:30:58 -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 1sZT5E-00083M-EB for emacs-devel@gnu.org; Thu, 01 Aug 2024 06:30:56 -0400 Original-Received: from sonic312-23.consmr.mail.ne1.yahoo.com ([66.163.191.204]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sZT5B-0000AC-Sh for emacs-devel@gnu.org; Thu, 01 Aug 2024 06:30:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1722508251; bh=68aulLuLx2hJYlXCbZZO4BxtRbdqhv8Aj15VNfaYXPg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=rcRTuL/lD41FnKzfytmLvt8TC0LfS539tzbLPLKPb29j3wFUbmBAqboxlV2w0MZN9CCC0pU7BySmy6FVkf1sR4dy49efOaEAUruTxQ8/tziphmWuQa/SxxW6I8CtUM/gd/WtzGurI+NNOgd545C2IfJqC6jUrmxoRloAl9sMul80eiY+tgkZIUHVudovigRL7BcZEm/7rxyhB1Eo6f/vzNAoEO88+VpE2IeyvxLi23TY2v/CaePD3oA30sfH77P4Kxn4SvpkKSHrsIAYJLN+LgB4W7CgDjUydbHa/MAKccc/PvolkO05+mjYu5NHI+Gwfw7oVDJrI8JkoYFblqKcPA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1722508251; bh=zVRM0qAEcnv3eRUX1DfmmCV6OW+wVgjV6N5I0B4cQOT=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=RSk1Uw/3bDcZHyvhVs5p2bgDPD4E/3N2JM42UT33QTNlIKgLVoNJvN8ZFscLET4S2vsH6INQQnoLqnb9U/+CMc48SfqJ5HN7dQ9SFbN/4hhQFHUQ5ZCVYyo+ys63h1MhTIQX6fg3o43gmkceTQ+foTQStVEBuFTruPt/JkdFf+bL26D11Ni2SAOZX8sDp+/OLTiP6xNLXStJ2VxSzZoiTnjjWZV7TBxg+VEnJp+xifuMJNT700lRkdZPXUYviCEnjT1DKI6wjQCsaJGnGknG/0JW38yOON113ab7f4VHqWF4MqX4UQbjKYChp8vyVDRaGpsFv12oCuAU2dUZmYz0xw== X-YMail-OSG: cQ.cbaAVM1kvem5r_.uMClBHjvu2jKDSw.YpK2iwlGbbAG8MRHSvpFYlsi39.YY koRaH8VIzeLxta4MUdfVY9y6H080LAAKDKz9JqQkDprOV71APlV2.Ad4FVJ4wNJVGRnMv3YxgZlB AfP3ezfqE7kfLrSGQuu6_BnHM3Vesyr1DfcRySAlxPNukDP.v2UtvKc50iUyE6z9V03kCkXIBlV5 xZmA_XrsH.9s4HQ5lcQxEI3htBOnye967CcJfV7adt8LxeopmCd1Mg3ZKf6CdYaWhYrR0ITWcQbr P4wrkjIEvLnTnDFJvOWFT14zcFxpdnVP7tqap.H1_EaQgVeqXe8IpHG1JBpCy7PxZ7Mk_wybeZ.S WsT.P8oc5hSQXgQDZ_GKl1Amg.bCFE.sRZTMfHEx4ZsSsWZym_Gi3eVP1U.5CBTYo0OVRx.0Q6Ha BY3ET1y1oFtl7__xoCN0osG_fP6cQNkjwpzNB_3hvQAoeeAVLYoFN1GEDcdIFDYfIj4nrywuFPQI 33xwpBZHAgLRfRgIE9mYOdKD0vlHsNzeZYqeBRNKLpk1m0Y01fdNZoKQ59TyEKmBALM9UBVZOds0 x8sCJdcDaCqvYqJS7Y9oiTjVsvvmTWYNtiFcYysASFwl9jjHSVYE4XH0Zg3k6GTKpxL0kaBjxHXs 9_iUBNqozWgiMRvg4ITyaxDoepk5vwo3BQWwyK.Ly6pBeaax23oNslAtUzs3UwhuEYz9LgFFDqu1 cmrGp9pjMiXAnoL_KoE3KrWD_fOPsBT23DQuA6XiN7SvI4mp4Obr8zo8XWEgrKk9sK9ThqXIEStm VwyRhts.Lwbmezhy8hGfhlokPJRntAJeJwkqBzoBOg X-Sonic-MF: X-Sonic-ID: 6f516f2b-e6cc-4d05-9f5c-43ea0f7f68e5 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.ne1.yahoo.com with HTTP; Thu, 1 Aug 2024 10:30:51 +0000 Original-Received: by hermes--production-sg3-fc85cddf6-flkd9 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID bd64e5b0796e7ee60b7f6ee87724ac8e; Thu, 01 Aug 2024 10:30:44 +0000 (UTC) In-Reply-To: <86sevowp2q.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 01 Aug 2024 12:49:01 +0300") X-Mailer: WebService/1.1.22544 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.191.204; envelope-from=luangruo@yahoo.com; helo=sonic312-23.consmr.mail.ne1.yahoo.com 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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:322265 Archived-At: Eli Zaretskii writes: >> From: Po Lu >> Cc: emacs-devel@gnu.org >> Date: Thu, 01 Aug 2024 16:16:58 +0800 >> >> Eli Zaretskii writes: >> >> > I don't understand what you are saying. What is "my discovery"? And >> > why no font will ever match the font spec for 'han'? I've definitely >> > seen fonts that support _all_ of the characters I added to >> > script-representative-chars, so why wouldn't they be found? >> >> I wasn't implying that no font will ever support one or more of these >> characters, but that such fonts are sufficiently obscure that the >> chances of a CJK font's being located by this value of >> `script-representative-chars' is nil. > > I very much doubt that. I see a few fonts on my Windows 11 system > which support all of those. I'd be very surprised to know that no > such fonts are available on a modern GNU/Linux system. > > Can someone please check that? I think I just did, but anyone is more than welcome to put the links I posted into Firefox. >> These characters may be han script, but they are not attested in CJK >> documents in practice, except in contrived scenarios such as conversions >> between incomplete character encodings. > > You keep saying that, but those are just your assertions. These > characters are there for a reason, and they should be supported as > well as we can. If worse comes to worst, we could split 'han' into > two or more scripts, and have separate setup in our fontsets for them. > Then each one could use its own representative characters. I keep saying this because I read and write CJK characters in Emacs and elsewhere, every day, without ever encountering the characters in question, since, had I done so, the tofu would not have escaped my notice. > Not IME. With respect, I think I write within compass when I say that no one has expressed enough interest in these characters to persuade Noto developers of their importance despite having nearly a decade: https://github.com/notofonts/noto-cjk/issues/13 and so these characters are likely to remain unavailable from a single font on GNU/Linux systems for the foreseeable future. >> > If there's no fonts installed that support those representative >> > characters, and Emacs is capable of finding less capable fonts that >> > support some of CJK (e.g., the BMP blocks), then why is that a >> > problem? >> >> I thought I explained that Emacs is _not_ capable of doing so on >> Android. > > Then please design and implement a suitable solution for Android. It > is not right to punish other platforms for Android-specific issues. No one is being punished or put at a disadvantage in any wise. Previously, script-representative-chars was downright ignored, an arrangement that existed till the Android port was installed and which has been restored, and no more. >> > The purpose of the change is to allow Emacs to find better fonts if >> > they are installed, instead of ignoring them. How is that a Bad >> > Thing? >> >> Because it renders the `han' script incapable of matching any fonts that >> are installed in practice. > > Again, not IME. Any GNU/Linux user is perfectly welcome to run: (dolist (char '(#x20000 #x2a700 #x2b740 #x2b820 #x2ceb0)) (insert (format "%c" char))) and reach the same conclusion I have. >> > I still don't understand why this breaks Android, btw. If Emacs >> > employs the fallback font specs with :lang you show above, why don't >> > they work for Android? >> >> The problem is that QClang is not available on Android, because fonts do >> not provide their design languages in one of the standard TrueType >> tables its font backend groks, which deficiency prompted the addition of >> the font spec in question in: > > OK, then it means we need to work around this, but without hampering > other platforms. Yes, that's the essence of the change installed in emacs-30. >> The fact of the matter is that: >> >> (let ((script-representative-chars >> '((han #x2e90 #x2f00 #x3010 #x3200 #x3300 #x3400 >> #x31c0 #x4e10 #x5B57 #xfe30 #xf900 >> #x1f210 #x20000 #x2a700 #x2b740 #x2b820 #x2ceb0 #x2f804)))) >> (clear-font-cache) >> (find-font (font-spec :registry "iso10646-1" :script 'han >> :type 'xfthb))) ;; or another ftfont backend. >> >> returns no font on an up-to-date Fedora Workstation installation with a >> wealth of multilingual fonts for CJK scripts, whereas: >> >> (let ((script-representative-chars >> '((han #x2e90 #x2f00 #x3010 #x3200 #x3300 #x3400 >> #x31c0 #x4e10 #x5B57 #xfe30 #xf900)))) >> (clear-font-cache) >> (find-font (font-spec :registry "iso10646-1" :script 'han >> :type 'xfthb))) >> >> returns: >> >> # >> >> which is more than adequate for editing CJK text in my language and >> others. > > Not on MS-Windows: here, both of the above return > > # > > which is a lie in the latter case, since those additional characters > are not supported by this font. Given that this method is evidently > unreliable, I don't think we should consider this a proof of your > argument. That's queer, and I suspect something is amiss in clear-font-cache. Nevertheless, the results from Mozilla are essentially conclusive, as far as I am concerned.