summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2020-04-03 17:43:04 -0700
committerKeith Packard <keithp@keithp.com>2020-04-03 17:43:04 -0700
commit26a3a497409279d74827f374e65ae4b8d3c1f1f7 (patch)
tree519fdd1f87c45e0fb4dc8d21643e6b56c7b2f7b2
parent972fa05c3df73fd3c99c409c0ac2225a58f76d09 (diff)
downloadxorg-lib-libXft-26a3a497409279d74827f374e65ae4b8d3c1f1f7.tar.gz
Skip 'render' pattern elements with invalid type
Fontconfig no longer supports the FcNameRegisterObjectTypes API, which means that any Xft custom fields cannot be specified in a fontconfig name as those will always be set to FcTypeUnknown in the pattern. The only one of those we care about is XFT_RENDER, which was used to disable the Render extension, something most apps probably don't need to support in names anyways. Allow the call requesting this value to return FcResultTypeMismatch and pretend that XFT_RENDER is missing from the pattern. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--src/xftfreetype.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/xftfreetype.c b/src/xftfreetype.c
index b0ef2bf..1f79a81 100644
--- a/src/xftfreetype.c
+++ b/src/xftfreetype.c
@@ -499,6 +499,15 @@ XftFontInfoFill (Display *dpy, _Xconst FcPattern *pattern, XftFontInfo *fi)
if (info->hasRender)
{
switch (FcPatternGetBool (pattern, XFT_RENDER, 0, &fi->render)) {
+ case FcResultTypeMismatch:
+ /*
+ * Fontconfig no longer supports xft's custom values in
+ * text patterns, so any name specifying render:true or
+ * render:false will have an invalid type in the resulting
+ * pattern. Just ignore that case so that the app doesn't
+ * just fail
+ */
+ /* fall through ... */
case FcResultNoMatch:
fi->render = info->hasRender;
break;