fontconfig: Branch 'master'

[email protected] (Behdad Esfahbod)
Newsgroups gmane.comp.fonts.fontconfig
Message-ID <[email protected]>
 src/fcmatch.c |   20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

New commits:
commit 6d1d44d5ec5100a3db850dddd7b4e4196e8a5cdb
Author: Behdad Esfahbod <[email protected]>
Date:   Tue Dec 19 15:51:16 2017 -0500

    Let pattern FC_FONT_VARIATIONS override standard axis variations
    
    Ie. flip the merge order.

diff --git a/src/fcmatch.c b/src/fcmatch.c
index 4656417..22c3784 100644
--- a/src/fcmatch.c
+++ b/src/fcmatch.c
@@ -540,12 +540,7 @@ FcFontRenderPrepare (FcConfig	    *config,
     FcPatternObjectGetBool (font, FC_VARIABLE_OBJECT, 0, &variable);
     assert (variable != FcDontCare);
     if (variable)
-    {
-	FcChar8 *vars = NULL;
 	FcStrBufInit (&variations, NULL, 0);
-	if (FcPatternObjectGetString (pat, FC_FONT_VARIATIONS_OBJECT, 0, &vars) == FcResultMatch)
-	    FcStrBufString (&variations, vars);
-    }
 
     new = FcPatternCreate ();
     if (!new)
@@ -739,11 +734,18 @@ FcFontRenderPrepare (FcConfig	    *config,
 	}
     }
 
-    if (variable)
+    if (variable && variations.len)
     {
-      FcPatternObjectDel (new, FC_FONT_VARIATIONS_OBJECT);
-      FcPatternObjectAddString (new, FC_FONT_VARIATIONS_OBJECT, FcStrBufDoneStatic (&variations));
-      FcStrBufDestroy (&variations);
+	FcChar8 *vars = NULL;
+	if (FcPatternObjectGetString (new, FC_FONT_VARIATIONS_OBJECT, 0, &vars) == FcResultMatch)
+	{
+	    FcStrBufChar (&variations, ',');
+	    FcStrBufString (&variations, vars);
+	    FcPatternObjectDel (new, FC_FONT_VARIATIONS_OBJECT);
+	}
+
+	FcPatternObjectAddString (new, FC_FONT_VARIATIONS_OBJECT, FcStrBufDoneStatic (&variations));
+	FcStrBufDestroy (&variations);
     }
 
     FcConfigSubstituteWithPat (config, new, pat, FcMatchFont);
_______________________________________________
Fontconfig mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/fontconfig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.