[fcformat] Add a 'pkgkit' builtin that prints tags for font packages

For DejaVu Sans Condensed it generates:

font(dejavusans)
font(dejavusanscondensed)
font(:lang=aa)
font(:lang=ab)
...
font(:lang=yo)
font(:lang=zu)
This commit is contained in:
Behdad Esfahbod 2009-02-13 16:41:37 -08:00
parent 9d58d01c5c
commit 384542fa91
1 changed files with 2 additions and 0 deletions

View File

@ -38,6 +38,7 @@
#define FCMATCH_FORMAT "%{file:-<unknown filename>|basename}: \"%{family[0]:-<unknown family>}\" \"%{style[0]:-<unknown style>}\"" #define FCMATCH_FORMAT "%{file:-<unknown filename>|basename}: \"%{family[0]:-<unknown family>}\" \"%{style[0]:-<unknown style>}\""
#define FCLIST_FORMAT "%{?file{%{file}: }}%{=unparse}" #define FCLIST_FORMAT "%{?file{%{file}: }}%{=unparse}"
#define PKGKIT_FORMAT "%{[]family{font(%{family|downcase|delete( )})\n}}%{[]lang{font(:lang=%{lang|downcase|translate(_,-)})\n}}"
static void static void
@ -267,6 +268,7 @@ interpret_builtin (FcFormatContext *c,
ret = FcPatternFormatToBuf (pat, (const FcChar8 *) format, buf) ret = FcPatternFormatToBuf (pat, (const FcChar8 *) format, buf)
BUILTIN ("fcmatch", FCMATCH_FORMAT); BUILTIN ("fcmatch", FCMATCH_FORMAT);
BUILTIN ("fclist", FCLIST_FORMAT); BUILTIN ("fclist", FCLIST_FORMAT);
BUILTIN ("pkgkit", PKGKIT_FORMAT);
#undef BUILTIN #undef BUILTIN
else else
ret = FcFalse; ret = FcFalse;