Switch fc-match to use FcPatternFormat()
Fix small bug in FcPatternFormat that was letting element-default to consume the convertor sequence.
This commit is contained in:
parent
e0be405a1d
commit
a15ac5d384
|
@ -195,6 +195,14 @@ main (int argc, char **argv)
|
||||||
}
|
}
|
||||||
FcPatternDestroy (pat);
|
FcPatternDestroy (pat);
|
||||||
|
|
||||||
|
if (!format)
|
||||||
|
{
|
||||||
|
if (os)
|
||||||
|
format = "%{=unparse}\n";
|
||||||
|
else
|
||||||
|
format = "%{=fcmatch}\n";
|
||||||
|
}
|
||||||
|
|
||||||
if (fs)
|
if (fs)
|
||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
|
@ -209,7 +217,7 @@ main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
FcPatternPrint (font);
|
FcPatternPrint (font);
|
||||||
}
|
}
|
||||||
else if (format)
|
else
|
||||||
{
|
{
|
||||||
FcChar8 *s;
|
FcChar8 *s;
|
||||||
|
|
||||||
|
@ -220,34 +228,6 @@ main (int argc, char **argv)
|
||||||
free (s);
|
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 *) "<unknown filename>";
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FcChar8 *slash = (FcChar8 *) strrchr ((char *) file, '/');
|
|
||||||
if (slash)
|
|
||||||
file = slash+1;
|
|
||||||
}
|
|
||||||
if (FcPatternGetString (font, FC_FAMILY, 0, &family) != FcResultMatch)
|
|
||||||
family = (FcChar8 *) "<unknown family>";
|
|
||||||
if (FcPatternGetString (font, FC_STYLE, 0, &style) != FcResultMatch)
|
|
||||||
style = (FcChar8 *) "<unknown style>";
|
|
||||||
|
|
||||||
printf ("%s: \"%s\" \"%s\"\n", file, family, style);
|
|
||||||
}
|
|
||||||
|
|
||||||
FcPatternDestroy (font);
|
FcPatternDestroy (font);
|
||||||
}
|
}
|
||||||
|
|
|
@ -732,7 +732,7 @@ interpret_simple (FcFormatContext *c,
|
||||||
c->word = c->word + strlen ((const char *) c->word) + 1;
|
c->word = c->word + strlen ((const char *) c->word) + 1;
|
||||||
/* for now we just support 'default value' */
|
/* for now we just support 'default value' */
|
||||||
if (!expect_char (c, '-') ||
|
if (!expect_char (c, '-') ||
|
||||||
!read_chars (c, '\0'))
|
!read_chars (c, '|'))
|
||||||
{
|
{
|
||||||
c->word = orig;
|
c->word = orig;
|
||||||
return FcFalse;
|
return FcFalse;
|
||||||
|
|
Loading…
Reference in New Issue