]> git.wh0rd.org Git - fontconfig.git/commitdiff
[fcformat] Add a 'pkgkit' builtin that prints tags for font packages
authorBehdad Esfahbod <behdad@behdad.org>
Sat, 14 Feb 2009 00:41:37 +0000 (16:41 -0800)
committerBehdad Esfahbod <behdad@behdad.org>
Mon, 16 Feb 2009 10:14:30 +0000 (02:14 -0800)
For DejaVu Sans Condensed it generates:

font(dejavusans)
font(dejavusanscondensed)
font(:lang=aa)
font(:lang=ab)
...
font(:lang=yo)
font(:lang=zu)

src/fcformat.c

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