]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix font matching of "Fira Code Retina" and "Fira Code Regular" on Haiku
authorPo Lu <luangruo@yahoo.com>
Tue, 3 May 2022 02:44:00 +0000 (02:44 +0000)
committerPo Lu <luangruo@yahoo.com>
Tue, 3 May 2022 02:44:16 +0000 (02:44 +0000)
* 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

index cc4eba5c294bd1f54a19ccbe80847deedb151329..339634f01be2b1a06085f038505eee1bf8aca31c 100644 (file)
@@ -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