[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#49797: 28.0.50; Setting face to custom fontset doesn't work
From: |
Yuan Fu |
Subject: |
bug#49797: 28.0.50; Setting face to custom fontset doesn't work |
Date: |
Thu, 7 Oct 2021 13:13:28 -0700 |
> On Oct 6, 2021, at 12:02 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>
>> From: Yuan Fu <casouri@gmail.com>
>> Date: Wed, 6 Oct 2021 11:56:18 -0700
>> Cc: Kenichi Handa <handa@gnu.org>,
>> 49797@debbugs.gnu.org
>>
>>>> fontset = FONTSET_FROM_ID (face->fontset);
>>>>
>>>> Then find an appropriate font from it
>>>>
>>>> rfont_def = fontset_font (fontset, c, face, id);
>>>
>>> Yes, AFAIU that's the part where we check if the current face's
>>> fontset's font, made for the ASCII characters, happens to have a glyph
>>> for the non-ASCII character we need to display.
>>
>> That is not, the part you mentioned is before:
>>
>> if (face->ascii_face->font)
>> {
>> XSETFONT (font_object, face->ascii_face->font);
>> if (font_has_char (f, font_object, c))
>> return face->ascii_face->id;
>> }
>
> No, this is where we try to use the ASCII font for symbols and
> punctuation characters.
You are right.
>
>> And what about the comment I mentioned? Did you read it?
>
> Yes, but it has no relevance to the issue at hand. That whole part is
> about displaying symbol and punctuation characters.
It IMO reveals the writer’s intent that fontset can be used to force a face to
display certain characters with certain font. I won’t insist on proving this,
tho.
>
>> In any case,
>>
>> rfont_def = fontset_font (fontset, c, face, id);
>>
>> finds a font in the fontset that can display character c. That’s hard to
>> ignore.
>
> I didn't.
Ok.
>
>>> As mentioned earlier, user code is not supposed to set the :fontset
>>> attribute directly, which is why it isn't documented.
>>
>> Finternal_set_lisp_face_attribute has code that let me set :fontset. Why is
>> it there if Lisp is not supposed to set :fontset?
>
> How is that relevant? That something is possible doesn't mean it's
> recommended.
Ok.
>
>> Plus, Emacs doesn’t set :fontset by itself
>
> It does, via the Lisp attributes and LFACE_FONTSET_INDEX. That's what
> matters on the C level.
Ok.
Still, I believe fontset is supposed to be used as I described. Let’s wait for
Handa-san.
Thanks,
Yuan
- bug#49797: 28.0.50; Setting face to custom fontset doesn't work, (continued)
- bug#49797: 28.0.50; Setting face to custom fontset doesn't work, Eli Zaretskii, 2021/10/05
- bug#49797: 28.0.50; Setting face to custom fontset doesn't work, Yuan Fu, 2021/10/05
- bug#49797: 28.0.50; Setting face to custom fontset doesn't work, Eli Zaretskii, 2021/10/06
- bug#49797: 28.0.50; Setting face to custom fontset doesn't work, Yuan Fu, 2021/10/06
- bug#49797: 28.0.50; Setting face to custom fontset doesn't work, Eli Zaretskii, 2021/10/06
- bug#49797: 28.0.50; Setting face to custom fontset doesn't work, Yuan Fu, 2021/10/06
- bug#49797: 28.0.50; Setting face to custom fontset doesn't work, Eli Zaretskii, 2021/10/06
- bug#49797: 28.0.50; Setting face to custom fontset doesn't work,
Yuan Fu <=
- bug#49797: 28.0.50; Setting face to custom fontset doesn't work, Eli Zaretskii, 2021/10/08
- bug#49797: 28.0.50; Setting face to custom fontset doesn't work, Yuan Fu, 2021/10/08