Subject: bug#67269: 30.0.50; italic face fallback does not assume italic properties

From: Eli Zaretskii <[email-masked]>
Date: Sun, 19 Nov 2023 08:37:55 +0200

tags 67269 notabug
thanks

> Date: Sun, 19 Nov 2023 14:01:04 +0800
> From:  Po Lu via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> When the default font doesn't supply an Italic variant, the italic face
> is assigned an underline propery in its place.  But when the italic face
> is merged with another face whose font does supply such a variant, the
> underline is applied all the same while the slant that would ideally be
> also is disregarded.
> 
> Hence if the default font is set to Droid Sans Mono (with no Italic
> variant) while shr-text is set to Times New Roman, italic text rendered
> by shr:
> 
>   (shr-text italic)
> 
> is underlined rather than slanted.  Moreover, no underline or slant is
> manifested if there is an Italic variant to the default font but not the
> face being merged with italic, depriving such italic text of any visual
> distinctiveness.

I see no bug here.  You are talking about faces defined with defface,
which are always based on the default font.  Given that fact, there's
not much we can do here, except perhaps keep the :slant attribute
together with :underline (although that's questionable, and I'm not
sure we should do that).  Removing the underline when a non-default
font does have the italic variant is not TRT, since it will cause
parts of the text appear with an underline and other parts without it.

Basically, choosing a default font that doesn't have the italic
variant is simply a bad idea, so what you describe is a cockpit error,
not an Emacs bug.