Commit Graph

29 Commits

Author SHA1 Message Date
Mike Frysinger e3a66c2937 delete unused variables
Newer gcc is better at detecting set-but-unused variables.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-02-21 14:15:58 -05:00
Behdad Esfahbod e61eba94ef Switch fc-cat to use FcPatternFormat()
Added the a builtin "fccat" to FcPatternFormat().
2011-06-20 11:55:25 -04:00
Behdad Esfahbod a15ac5d384 Switch fc-match to use FcPatternFormat()
Fix small bug in FcPatternFormat that was letting element-default to
consume the convertor sequence.
2011-06-20 11:32:46 -04:00
Behdad Esfahbod e0be405a1d Bug 26718 - "fc-match sans file" doesn't work
- Do not throw away FC_FILE in FcNameUnparse
- Update the builtin "fclist" format to remove FC_FILE properly instead
- Switch fc-list to use FcPatternFormat()

Note that I had previously broken fc-list and it was not showing the
file name anymore.  No one noticed that it seems!  Now fixed.
2011-06-20 11:22:17 -04:00
Behdad Esfahbod c76ed777dd Bug 30566 - fcformat.c:interpret_enumerate() passes uninitialized idx to FcPatternGetLangSet() 2011-03-14 18:04:59 -03:00
Behdad Esfahbod 5aaf466d38 Cleanup copyright notices to replace "Keith Packard" with "the author(s)" 2010-11-10 16:45:42 -05:00
Behdad Esfahbod 25afea879d Add comments 2010-08-18 11:31:31 -04:00
Behdad Esfahbod caeea376da Document FcPatternFormat() format 2009-03-13 19:06:43 -04:00
Behdad Esfahbod f6d8343989 [fcformat] Fix default-value handling 2009-03-13 17:59:29 -04:00
Behdad Esfahbod 3074a73b41 Replace 'KEITH PACKARD' with 'THE AUTHOR(S)' in license text in all files 2009-03-13 17:59:28 -04:00
Behdad Esfahbod 04ac14fc14 [fcformat] Add list of undocumented language features 2009-02-16 02:14:41 -08:00
Behdad Esfahbod 384542fa91 [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)
2009-02-16 02:14:30 -08:00
Behdad Esfahbod 9d58d01c5c [fcformat] Enumerate langsets like we do arrays of values
If one asks for a format like '%{[]elt{expr}}' and the first value
for elt is a langset, we enumerate the langset languages in expr.
2009-02-15 14:13:38 -08:00
Behdad Esfahbod cdfb76585e [fcformat] Implement array enumeration
The format '%{[]family,familylang{expr}}' expands expr once for the first
value of family and familylang, then for the second, etc, until both lists
are exhausted.
2009-02-15 13:40:31 -08:00
Behdad Esfahbod 0673ef3881 [fcformat] Support 'default value' for simple tags
The format '%{family:-XXX} prints XٓٓٓٓXX if the element family is not defined.
Also works for things like '%{family[1]:-XXX}'.
2009-02-15 13:40:30 -08:00
Behdad Esfahbod 9c83a8376f [fcformat] Support indexing simple tags
The format '%{family[0]}' will only output the first value for element family.
2009-02-15 13:40:30 -08:00
Behdad Esfahbod d04a750764 [fcformat] Add support for builtin formats
The '%{=unparse}' format expands to the FcNameUnparse() result on the
pattern.  Need to add '%{=verbose}' for FcPatternPrint() output but
need to change that function to output to a string first.

Also added the '%{=fclist}' and '%{=fcmatch}' which format like the
default format of fc-list and fc-match respectively.
2009-02-15 13:40:30 -08:00
Behdad Esfahbod 85c7fb67ce [fcformat] Refactor code to avoid malloc 2009-02-15 13:40:30 -08:00
Behdad Esfahbod d4f7a4c6af [fcformat] Start adding builtins 2009-02-15 13:40:29 -08:00
Behdad Esfahbod c8f5933d13 [fcformat] Implement 'delete', 'escape', and 'translate' filter functions
The format '%{family|delete( )}' expands to family values with space removed.
The format '%{family|translate( ,-)}' expands to family values with space
replaced by dash.  Multiple chars are supported, like tr(1).
The format '%{family|escape(\\ )}' expands to family values with space
escaped using backslash.
2009-02-15 13:40:29 -08:00
Behdad Esfahbod b6a23028be [fcformat] Add value-count syntax
The format '%{#family}' expands to the number of values for the element
'family', or '0' if no such element exists in the pattern.
2009-02-15 13:40:29 -08:00
Behdad Esfahbod ced38254b4 [fcformat] Implement 'cescape', 'shescape', and 'xmlescape' converters 2009-02-15 13:40:28 -08:00
Behdad Esfahbod 2017a5eb79 [fcformat] Add simple converters
The format '%{family|downcase}' for example prints the lowercase of
the family element.  Three converters are defined right now:
'downcase', 'basename', and 'dirname'.
2009-02-15 13:40:27 -08:00
Behdad Esfahbod 7717b25ffd [fcformat] Add conditionals
The conditional '%{?elt1,elt2,!elt3{expr1}{expr2}}' will evaluate
expr1 if elt1 and elt2 exist in pattern and elt3 doesn't exist, and
expr2 otherwise.  The '{expr2}' part is optional.
2009-02-15 13:40:27 -08:00
Behdad Esfahbod 8c31a2434d [fcformat] Add element filtering and deletion
The filtering, '%{+elt1,elt2,elt3{subexpr}}' will evaluate subexpr
with a pattern only having the listed elements from the surrounding
pattern.

The deletion, '%{-elt1,elt2,elt3{subexpr}}' will evaluate subexpr
with a the surrounding pattern sans the listed elements.
2009-02-15 13:40:26 -08:00
Behdad Esfahbod d6506ff6ee [fcformat] Add support for subexpressions
The syntax is '{{expr}}'.  Can be used for aligning/justifying an entire
subexpr for example.
2009-02-15 13:40:26 -08:00
Behdad Esfahbod 27b3e2dddf [fcformat] Refactor and restructure code for upcoming changes
Also makes it thread-safe.
2009-02-15 13:40:26 -08:00
Behdad Esfahbod c493c3b770 [fcformat] Add support for width modifiers
One can do '%30{family}' for example.  Or '%-30{family}' for the
left-aligned version.
2009-02-15 13:40:25 -08:00
Behdad Esfahbod 0c93b91db0 Implement FcPatternFormat and use it in cmdline tools (bug #17107)
Still need to add more features, but the API is there, and used
by cmdline tools with -f or --format.
2009-02-13 16:54:04 -08:00