From ec3ac5609a95d9338744d2e39af3a29c6349d2d5 Mon Sep 17 00:00:00 2001
From: Akira TAGOH <akira@tagoh.org>
Date: Fri, 22 May 2026 08:07:00 +0900
Subject: [PATCH] Fix not matching with a font family name

Give higher priority to FC_FAMILY with the strong binding more than
FC_GENERIC_FAMILY. So even if we add a default value for
genericfamily in 49-sansserif.conf, a font that is actually
available on the system will be picked up when it matches a query.

https://gitlab.freedesktop.org/fontconfig/fontconfig/-/work_items/520

Changelog: fixed
---
 src/fcmatch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/fcmatch.c b/src/fcmatch.c
index e0ab9503..ea6c2243 100644
--- a/src/fcmatch.c
+++ b/src/fcmatch.c
@@ -330,8 +330,8 @@ typedef enum _FcMatcherPriority {
     PRI1 (COLOR),
     PRI1 (FOUNDRY),
     PRI1 (CHARSET),
-    PRI1 (GENERIC_FAMILY),
     PRI_FAMILY_STRONG,
+    PRI1 (GENERIC_FAMILY),
     PRI_POSTSCRIPT_NAME_STRONG,
     PRI1 (LANG),
     PRI_FAMILY_WEAK,
-- 
GitLab

