+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
FcChar8 *
FcNameUnparse (FcPattern *pat)
{
+ return FcNameUnparseEscaped (pat, FcTrue);
+}
+
+FcChar8 *
+FcNameUnparseEscaped (FcPattern *pat, FcBool escape)
+{
FcStrBuf buf;
FcChar8 buf_static[8192];
int i;
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);
{
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)
{
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;
}
}