Subject: Re: bug#70989: 29.3; Calling isearch-forward when using Unifont throws error "Invalid font name"

From: Eli Zaretskii <[email-masked]>
Date: Sun, 19 May 2024 09:05:21 +0300

> From: Po Lu <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Sun, 19 May 2024 08:15:14 +0800
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > Sorry, can you elaborate a bit, please?  Specifically:
> >
> >   . which code in get_adstyle_property does this, and how?
> 
> Not "which code", but "the code", in that the function doesn't actively
> generate adstyles inappropriate for XLFDs, but duly returns such
> adstyles when Fontconfig reports the same.

Sorry, I still don't understand what you are saying.  Could you please
talk me through the code in that function, and tell where does
"Sans-Serif" come from and how is it "injected" into the font's
attributes?

What I see there is the call to fond_intern_prop, and if the result is
accepted by font_style_to_value as a valid value of FONT_WIDTH_INDEX,
it is returned.  But "Sans-Serif" is not supposed to be a valid width
of a font, so I'm confused.

> >   . what is your idea for a fix, which led you to ask about "the
> >     chances that a font will define two adstyles that collide"?
> 
> Replacing instances of "-" with "_" in adstyles.

In what string or symbol name that is being processed in
get_adstyle_property?