fontconfig: ignore failure to return FC_INDEX assume its zero

Sigh. The number of creative ways Linux systems can be broken.
See #10112
This commit is contained in:
Kovid Goyal 2026-06-06 18:46:15 +05:30
parent 6839281277
commit 40ed8cfd3c
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -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