]> git.wh0rd.org - fontconfig.git/blobdiff - fc-list/fc-list.c
Bug 26718 - "fc-match sans file" doesn't work
[fontconfig.git] / fc-list / fc-list.c
index e7813a6b4ca914d6680dea3955fd50cc64253e97..ad383328e2d1f3a1d5cd8fcd9b98054b08f1d784 100644 (file)
@@ -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.
  *
@@ -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);
-           }
        }
     }