X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=fc-match%2Ffc-match.c;h=e64b4bcdd37092575dfaf28aa2efca01dba7c0fa;hb=a15ac5d3840552528874f1d5ad166eb00906ce80;hp=8963e7af35fc9dedbec9435a0cb58add949897b5;hpb=3074a73b418b40135d4a4f4e0713fcf987d34795;p=fontconfig.git diff --git a/fc-match/fc-match.c b/fc-match/fc-match.c index 8963e7a..e64b4bc 100644 --- a/fc-match/fc-match.c +++ b/fc-match/fc-match.c @@ -7,9 +7,9 @@ * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in + * documentation, and that the name of the author(s) not be used in * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no + * specific, written prior permission. The authors make no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * @@ -195,6 +195,14 @@ main (int argc, char **argv) } FcPatternDestroy (pat); + if (!format) + { + if (os) + format = "%{=unparse}\n"; + else + format = "%{=fcmatch}\n"; + } + if (fs) { int j; @@ -209,7 +217,7 @@ main (int argc, char **argv) { FcPatternPrint (font); } - else if (format) + else { FcChar8 *s; @@ -220,34 +228,6 @@ main (int argc, char **argv) free (s); } } - else if (os) - { - FcChar8 *str; - str = FcNameUnparse (font); - printf ("%s\n", str); - free (str); - } - else - { - FcChar8 *family; - FcChar8 *style; - FcChar8 *file; - - if (FcPatternGetString (font, FC_FILE, 0, &file) != FcResultMatch) - file = (FcChar8 *) ""; - else - { - FcChar8 *slash = (FcChar8 *) strrchr ((char *) file, '/'); - if (slash) - file = slash+1; - } - if (FcPatternGetString (font, FC_FAMILY, 0, &family) != FcResultMatch) - family = (FcChar8 *) ""; - if (FcPatternGetString (font, FC_STYLE, 0, &style) != FcResultMatch) - style = (FcChar8 *) ""; - - printf ("%s: \"%s\" \"%s\"\n", file, family, style); - } FcPatternDestroy (font); }