diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2011-06-20 11:22:17 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2011-06-20 11:22:17 -0400 |
commit | e0be405a1dd5765e36152c754a47c8ad7ff0ab85 (patch) | |
tree | 5a02965a7ec142e5b27dced988f1ee893404eac7 /fc-list | |
parent | 0fcf866d44c46bd63d91f656e36544b6ce9af47d (diff) |
Bug 26718 - "fc-match sans file" doesn't work
- Do not throw away FC_FILE in FcNameUnparse
- Update the builtin "fclist" format to remove FC_FILE properly instead
- Switch fc-list to use FcPatternFormat()
Note that I had previously broken fc-list and it was not showing the
file name anymore. No one noticed that it seems! Now fixed.
Diffstat (limited to 'fc-list')
-rw-r--r-- | fc-list/fc-list.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/fc-list/fc-list.c b/fc-list/fc-list.c index 12c2ca55..ad383328 100644 --- a/fc-list/fc-list.c +++ b/fc-list/fc-list.c @@ -156,7 +156,9 @@ main (int argc, char **argv) if (quiet && !os) os = FcObjectSetCreate (); if (!verbose && !format && !os) - os = FcObjectSetBuild (FC_FAMILY, FC_STYLE, (char *) 0); + os = FcObjectSetBuild (FC_FAMILY, FC_STYLE, FC_FILE, (char *) 0); + if (!format) + format = "%{=fclist}\n"; fs = FcFontList (0, pat, os); if (os) FcObjectSetDestroy (os); @@ -173,7 +175,7 @@ main (int argc, char **argv) { FcPatternPrint (fs->fonts[j]); } - else if (format) + else { FcChar8 *s; @@ -184,17 +186,6 @@ main (int argc, char **argv) free (s); } } - else - { - FcChar8 *str; - FcChar8 *file; - - str = FcNameUnparse (fs->fonts[j]); - if (FcPatternGetString (fs->fonts[j], FC_FILE, 0, &file) == FcResultMatch) - printf ("%s: ", file); - printf ("%s\n", str); - free (str); - } } } |