From 0d5befb88243b1b92170f7c46664d6639b653f6c Mon Sep 17 00:00:00 2001 From: Po Lu Date: Tue, 3 May 2022 02:44:00 +0000 Subject: [PATCH] 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. --- src/haiku_font_support.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 -- 2.39.5