]> git.wh0rd.org - fontconfig.git/commitdiff
Make fc-match --sort call FcFontRenderPrepare.
authorBehdad Esfahbod <behdad@behdad.org>
Fri, 26 Oct 2007 04:35:45 +0000 (21:35 -0700)
committerKeith Packard <keithp@koto.keithp.com>
Fri, 26 Oct 2007 04:35:45 +0000 (21:35 -0700)
This makes the --sort and regular output the same for each font.

fc-match/fc-match.c

index 5f36f004fd0abeca1e97982e0a9d4ac038b60ecf..bf9817b8064d83bcdbc4075a7a1896350f6e79ef 100644 (file)
@@ -141,12 +141,28 @@ main (int argc, char **argv)
     FcConfigSubstitute (0, pat, FcMatchPattern);
     FcDefaultSubstitute (pat);
     
+    fs = FcFontSetCreate ();
+
     if (sort)
-       fs = FcFontSort (0, pat, FcTrue, 0, &result);
+    {
+       FcFontSet       *font_patterns;
+       int     j;
+       font_patterns = FcFontSort (0, pat, FcTrue, 0, &result);
+
+       for (j = 0; j < font_patterns->nfont; j++)
+       {
+           FcPattern  *font_pattern;
+
+           font_pattern = FcFontRenderPrepare (NULL, pat, font_patterns->fonts[j]);
+           if (font_pattern)
+               FcFontSetAdd (fs, font_pattern);
+       }
+
+       FcFontSetSortDestroy (font_patterns);
+    }
     else
     {
        FcPattern   *match;
-       fs = FcFontSetCreate ();
        match = FcFontMatch (0, pat, &result);
        if (match)
            FcFontSetAdd (fs, match);