[Fontconfig] Pattern Matching Issues

Tom Hacohen tom.hacohen at samsung.com
Thu Jan 30 07:14:29 PST 2014


Hey,

I have two issues with matching patterns with fontconfig.
1. Something seems wrong with FcFontSort in some cases. I've tried it 
both with fc-match and with code.
If I run "fc-match :spacing=100" it finds the default font (doesn't have 
spacing=100), however if I run fc-list with the same parameter, I get a 
filtered result that doesn't include the default system font.
It seems that fc-match is misbehaving, or am I missing something?

2. Both FcFontSort and FcFontList don't work for me with "ftface" as a 
filtering parameter.
Testing:
Use either of the attached c programs (modified versions of fc-match and 
fc-list) and try running them. I hard-coded a font path there (which 
correctly loads, I verified that), you might need to change that to a 
different path depending on your system (Arch here).
compile with:
gcc fc-list.c `pkg-config --cflags --libs fontconfig freetype2` list

I would expect it to filter according to the FT_Face, but it doesn't, 
any ideas?

If that's not what it's meant to do, what's the best way to load a list 
of "most similar to ftface" fonts available on the system? Do I have no 
analyse the face and create the pattern on my own?


I'm unsure if it's some misconfiguration here that's causing the havoc, 
or an actual issue with fontconfig. Looking forward to hear what you 
guys have to say.

Thanks,
Tom.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fc-list.c
Type: text/x-csrc
Size: 5191 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/fontconfig/attachments/20140130/5ff193e2/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fc-match.c
Type: text/x-csrc
Size: 6088 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/fontconfig/attachments/20140130/5ff193e2/attachment-0001.c>


More information about the Fontconfig mailing list