diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2007-10-25 21:35:45 -0700 |
---|---|---|
committer | Keith Packard <keithp@koto.keithp.com> | 2007-10-25 21:35:45 -0700 |
commit | 0602c605af04ea73af700b223ec4ac1dfd5a36f1 (patch) | |
tree | 7038ad3553cdb07f90ad0ba70c9309af0437dd03 /fc-match | |
parent | ad27687f725faf7df83b161c77e99bc7bedf5b3d (diff) |
Make fc-match --sort call FcFontRenderPrepare.
This makes the --sort and regular output the same for each font.
Diffstat (limited to 'fc-match')
-rw-r--r-- | fc-match/fc-match.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/fc-match/fc-match.c b/fc-match/fc-match.c index 5f36f004..bf9817b8 100644 --- a/fc-match/fc-match.c +++ b/fc-match/fc-match.c @@ -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); |