From 40ed8cfd3cc2d349b37d4b7eaa1de666fa58cd62 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 6 Jun 2026 18:46:15 +0530 Subject: [PATCH] fontconfig: ignore failure to return FC_INDEX assume its zero Sigh. The number of creative ways Linux systems can be broken. See #10112 --- kitty/fontconfig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kitty/fontconfig.c b/kitty/fontconfig.c index a6ef9707e..388ccf8b1 100644 --- a/kitty/fontconfig.c +++ b/kitty/fontconfig.c @@ -330,7 +330,7 @@ _native_fc_match(FcPattern *pat, FontConfigFace *ans) { FcChar8 *out; #define g(func, prop, output) if (func(match, prop, 0, &output) != FcResultMatch) { PyErr_SetString(PyExc_ValueError, "No " #prop " found in fontconfig match result"); goto end; } g(FcPatternGetString, FC_FILE, out); - g(FcPatternGetInteger, FC_INDEX, ans->index); + if (FcPatternGetInteger(match, FC_INDEX, 0, &ans->index) != FcResultMatch) ans->index = 0; // ignore missing index assume it is zero g(FcPatternGetInteger, FC_HINT_STYLE, ans->hintstyle); g(FcPatternGetBool, FC_HINTING, ans->hinting); #undef g