Make fc-match --sort call FcFontRenderPrepare.

This makes the --sort and regular output the same for each font.
This commit is contained in:
Behdad Esfahbod 2007-10-25 21:35:45 -07:00 committed by Keith Packard
parent ad27687f72
commit 0602c605af
1 changed files with 18 additions and 2 deletions

View 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);