From: Po Lu Date: Tue, 3 May 2022 02:44:00 +0000 (+0000) Subject: Fix font matching of "Fira Code Retina" and "Fira Code Regular" on Haiku X-Git-Tag: emacs-29.0.90~1931^2~119 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0d5befb88243b1b92170f7c46664d6639b653f6c;p=emacs.git Fix font matching of "Fira Code Retina" and "Fira Code Regular" on Haiku * src/haiku_font_support.cc (font_family_style_matches_p): Don't allow matches on fonts with an adstyle if none was specified in the input pattern. --- diff --git a/src/haiku_font_support.cc b/src/haiku_font_support.cc index cc4eba5c294..339634f01be 100644 --- a/src/haiku_font_support.cc +++ b/src/haiku_font_support.cc @@ -490,8 +490,8 @@ font_family_style_matches_p (font_family family, char *style, uint32_t flags, if (style) font_style_to_flags (style, &m); - if ((pattern->specified & FSPEC_FAMILY) && - strcmp ((char *) &pattern->family, family)) + if ((pattern->specified & FSPEC_FAMILY) + && strcmp ((char *) &pattern->family, family)) return false; if (!ignore_flags_p && (pattern->specified & FSPEC_SPACING) @@ -500,6 +500,10 @@ font_family_style_matches_p (font_family family, char *style, uint32_t flags, if (pattern->specified & FSPEC_STYLE) return style && !strcmp (style, pattern->style); + /* Don't allow matching fonts with an adstyle if no style was + specified in the query pattern. */ + else if (m.specified & FSPEC_STYLE) + return false; if ((pattern->specified & FSPEC_WEIGHT) && (pattern->weight