From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: pipcet@protonmail.com Newsgroups: gmane.emacs.devel Subject: Re: master bf0aeaa0d7a: Re-enable displaying `han' characters on Android Date: Sat, 03 Aug 2024 09:21:49 +0000 Message-ID: <871q36x8pi.fsf@protonmail.com> References: <86h6c5y39e.fsf@gnu.org> <86sevowp2q.fsf@gnu.org> <87frror0vs.fsf@yahoo.com> <87r0b7i4cn.fsf@turtle-trading.net> <86ttg3umzz.fsf@gnu.org> <87plqrm6dd.fsf@turtle-trading.net> <875xsj83ui.fsf@turtle-trading.net> <87cymqxepd.fsf@protonmail.com> <877ccyq984.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="8603"; 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 Sat Aug 03 17:18:59 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 1saGX4-00026f-Us for ged-emacs-devel@m.gmane-mx.org; Sat, 03 Aug 2024 17:18:58 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1saGWK-00034R-UQ; Sat, 03 Aug 2024 11:18:12 -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 1saAxb-0003GS-Ks for emacs-devel@gnu.org; Sat, 03 Aug 2024 05:21:59 -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 1saAxZ-0005EV-Gi; Sat, 03 Aug 2024 05:21:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1722676914; x=1722936114; bh=X3z9upVm5u1Lwlc6euAHrzV386clzUH51W972500gxE=; 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=Sphy5zBu4Q777LmVRpHC61VIbi6cggcQSdK8vQ9ejyHefs6aQ8Atc7Ua8Q0Oncm4T KTFrwhixHspNnzuy5uQwWwbixWRfrYANfkidSklF+Udi3GxXMOKPsRfIeilgpu08De Qa1td8MmXpujSZK6W1X6dBYqq1eo5a5EhFFMzDAowNL7tLTy7T7SPw97MO18m4/DAn AKAmWxKSkL+OcgK7kwJyt/Ln7A4JxCG7mfMFT/sFRyohhtXs8HBP47/rWQ2An96YCz 2B2A5uca2i1rU4kXaYHQsxtTgL1Y2tixyCTPkQ3dgWiLLW0RlnW5VQcxylqDYGtJ1f L1wsNsQDuUnOw== In-Reply-To: <877ccyq984.fsf@yahoo.com> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: e95850179c3d1656d430740a2687efd8bc410ee8 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: Sat, 03 Aug 2024 11:18:11 -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:322308 Archived-At: "Po Lu" writes: > pipcet@protonmail.com writes: > >> "Benjamin Riefenstahl" writes: >> >>> Benjamin Riefenstahl writes: >>>> I don't know what is going on. Must have been something I did earlier >>>> in that other session. >>> >>> It's the order. If I first evaluate the version with fewer characters, >>> I get a font for that and for the longer list of characters after that, >>> too. >> >> I've looked at that a little, and I don't think 'clear-font-cache', uh, >> clears the font cache. >> >> ftfont.c also interns random binary strings as symbols here. This helps: >> >> diff --git a/src/ftfont.c b/src/ftfont.c >> index c89feea1d46..882d3eec256 100644 >> --- a/src/ftfont.c >> +++ b/src/ftfont.c >> @@ -174,11 +174,11 @@ get_adstyle_property (FcPattern *p) >> USE_SAFE_ALLOCA; >> tmp =3D SAFE_ALLOCA (end - str); >> for (i =3D 0; i < end - str; ++i) >> - tmp[i] =3D ((end[i] !=3D '?' >> -=09 && end[i] !=3D '*' >> -=09 && end[i] !=3D '"' >> -=09 && end[i] !=3D '-') >> -=09 ? end[i] : ' '); >> + tmp[i] =3D ((str[i] !=3D '?' >> +=09 && str[i] !=3D '*' >> +=09 && str[i] !=3D '"' >> +=09 && str[i] !=3D '-') >> +=09 ? str[i] : ' '); >> adstyle =3D font_intern_prop (tmp, end - str, 1); >> SAFE_FREE (); >> if (font_style_to_value (FONT_WIDTH_INDEX, adstyle, 0) >=3D 0) > > [...] > >> sfntfont.c only looks at the first fixnum in a vector specified in >> Vscript_representative_chars, and fails if it isn't there, even though >> it should continue looking. > > These have been fixed. Thank you! One more thing I'm noticing is that on Android, the foundry string/ach_vendor_id is interned as OG^A@ rather than GOOG. It seems to me that removing the second read() call in daefd6771a4879bb8e71ea67f69522700155df01 may have caused the problem. IIUC, panose[] is four-byte-aligned, but ul_unicode_range is not, and that messes up our offsets. Is that correct? Are we actually using ul_unicode_range, by the way? >> xfont.c is particularly weird: it's limited to 64k characters, of >> course, but it also hardcodes 'han as a supported script for all >> Japanese or Korean fonts; and xfont_has_char will return false for all >> non-ASCII chars in iso10646-1 fonts that don't have "ja" or "ko" >> adstyles. In addition, it has its own caching mechanism >> (xfont_scripts_cache) which is never cleared, shrunk, or exposed to >> Lisp. > > No, xfont_has_char will return a value that indicates that the presence > of the character cannot be established without opening the font. You're right; I still wonder whether this is the intended behavior... Pip