all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: pipcet@protonmail.com
To: Po Lu <luangruo@yahoo.com>
Cc: Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>,
	Eli Zaretskii <eliz@gnu.org>,
	emacs-devel@gnu.org
Subject: Re: master bf0aeaa0d7a: Re-enable displaying `han' characters on Android
Date: Sat, 03 Aug 2024 09:21:49 +0000	[thread overview]
Message-ID: <871q36x8pi.fsf@protonmail.com> (raw)
In-Reply-To: <877ccyq984.fsf@yahoo.com>

"Po Lu" <luangruo@yahoo.com> writes:

> pipcet@protonmail.com writes:
>
>> "Benjamin Riefenstahl" <b.riefenstahl@turtle-trading.net> 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 = SAFE_ALLOCA (end - str);
>>    for (i = 0; i < end - str; ++i)
>> -    tmp[i] = ((end[i] != '?'
>> -	       && end[i] != '*'
>> -	       && end[i] != '"'
>> -	       && end[i] != '-')
>> -	      ? end[i] : ' ');
>> +    tmp[i] = ((str[i] != '?'
>> +	       && str[i] != '*'
>> +	       && str[i] != '"'
>> +	       && str[i] != '-')
>> +	      ? str[i] : ' ');
>>    adstyle = font_intern_prop (tmp, end - str, 1);
>>    SAFE_FREE ();
>>    if (font_style_to_value (FONT_WIDTH_INDEX, adstyle, 0) >= 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




  reply	other threads:[~2024-08-03  9:21 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-31 15:45 master bf0aeaa0d7a: Re-enable displaying `han' characters on Android Eli Zaretskii
2024-08-01  0:07 ` Po Lu
2024-08-01  0:33   ` Po Lu
2024-08-01  5:52     ` Eli Zaretskii
2024-08-01  7:55       ` Po Lu
2024-08-01  8:52         ` Eli Zaretskii
2024-08-01  9:47           ` Po Lu
2024-08-01  9:56             ` Eli Zaretskii
2024-08-01 10:13               ` Po Lu
2024-08-01 10:19                 ` Eli Zaretskii
2024-08-01 21:17             ` Dmitry Gutov
2024-08-01  5:32   ` Eli Zaretskii
2024-08-01  8:16     ` Po Lu
2024-08-01  9:49       ` Eli Zaretskii
2024-08-01 10:30         ` Po Lu
2024-08-01 10:35           ` Eli Zaretskii
2024-08-02 10:52           ` Benjamin Riefenstahl
2024-08-02 12:29             ` Eli Zaretskii
2024-08-02 12:55               ` Benjamin Riefenstahl
2024-08-02 13:13                 ` Benjamin Riefenstahl
2024-08-03  7:12                   ` pipcet
2024-08-03  8:52                     ` Po Lu
2024-08-03  9:21                       ` pipcet [this message]
2024-08-03  9:33                         ` Po Lu
2024-08-03 13:13                           ` pipcet
2024-08-03 13:31                             ` Po Lu
2024-08-03 14:31                               ` pipcet
2024-08-03 14:54                                 ` Po Lu
2024-08-07 17:52                                   ` Pip Cet
2024-08-08  0:10                                     ` Po Lu
2024-08-09 12:33                                       ` Pip Cet
2024-08-09 13:10                                         ` Po Lu
2024-08-03 15:15                     ` Eli Zaretskii
2024-08-02 10:44       ` Benjamin Riefenstahl
2024-08-02 11:42         ` Po Lu
2024-08-01  7:57   ` Andrea Corallo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871q36x8pi.fsf@protonmail.com \
    --to=pipcet@protonmail.com \
    --cc=b.riefenstahl@turtle-trading.net \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=luangruo@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.