Commit 2fa3f27e authored by Patrick Lam's avatar Patrick Lam

Prevent fc-list from escaping strings when printing them.

parent 250c1cd4
2005-10-21 Patrick Lam <plam@mit.edu>
* fc-list/fc-list.c (main):
* src/fcname.c (FcNameUnparse, FcNameUnparseEscaped):
* fontconfig/fontconfig.h:
Prevent fc-list from escaping strings when printing them.
2005-10-20 Marcus Meissner <meissner@suse.de>
reviewed by: plam
......
......@@ -150,7 +150,7 @@ main (int argc, char **argv)
FcChar8 *font;
FcChar8 *file;
font = FcNameUnparse (fs->fonts[j]);
font = FcNameUnparseEscaped (fs->fonts[j], FcFalse);
if (FcPatternGetString (fs->fonts[j], FC_FILE, 0, &file) == FcResultMatch)
printf ("%s: ", file);
printf ("%s\n", font);
......
......@@ -665,6 +665,9 @@ FcNameParse (const FcChar8 *name);
FcChar8 *
FcNameUnparse (FcPattern *pat);
FcChar8 *
FcNameUnparseEscaped (FcPattern *pat, FcBool escape);
/* fcpat.c */
FcPattern *
FcPatternCreate (void);
......
......@@ -823,6 +823,12 @@ FcNameUnparseValueList (FcStrBuf *buf,
FcChar8 *
FcNameUnparse (FcPattern *pat)
{
return FcNameUnparseEscaped (pat, FcTrue);
}
FcChar8 *
FcNameUnparseEscaped (FcPattern *pat, FcBool escape)
{
FcStrBuf buf;
FcChar8 buf_static[8192];
......@@ -835,7 +841,7 @@ FcNameUnparse (FcPattern *pat)
e = FcPatternFindElt (pat, FC_FAMILY);
if (e)
{
if (!FcNameUnparseValueList (&buf, e->values, (FcChar8 *) FC_ESCAPE_FIXED))
if (!FcNameUnparseValueList (&buf, e->values, escape ? (FcChar8 *) FC_ESCAPE_FIXED : 0))
goto bail0;
}
e = FcPatternFindElt (pat, FC_SIZE);
......@@ -843,7 +849,7 @@ FcNameUnparse (FcPattern *pat)
{
if (!FcNameUnparseString (&buf, (FcChar8 *) "-", 0))
goto bail0;
if (!FcNameUnparseValueList (&buf, e->values, (FcChar8 *) FC_ESCAPE_FIXED))
if (!FcNameUnparseValueList (&buf, e->values, escape ? (FcChar8 *) FC_ESCAPE_FIXED : 0))
goto bail0;
}
for (l = _FcObjectTypes; l; l = l->next)
......@@ -861,12 +867,12 @@ FcNameUnparse (FcPattern *pat)
{
if (!FcNameUnparseString (&buf, (FcChar8 *) ":", 0))
goto bail0;
if (!FcNameUnparseString (&buf, (FcChar8 *) o->object, (FcChar8 *) FC_ESCAPE_VARIABLE))
if (!FcNameUnparseString (&buf, (FcChar8 *) o->object, escape ? (FcChar8 *) FC_ESCAPE_VARIABLE : 0))
goto bail0;
if (!FcNameUnparseString (&buf, (FcChar8 *) "=", 0))
goto bail0;
if (!FcNameUnparseValueList (&buf, e->values,
(FcChar8 *) FC_ESCAPE_VARIABLE))
if (!FcNameUnparseValueList (&buf, e->values, escape ?
(FcChar8 *) FC_ESCAPE_VARIABLE : 0))
goto bail0;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment