Bug 16818

Summary: fontformat in match pattern is not respected?
Product: fontconfig Reporter: Behdad Esfahbod <freedesktop>
Component: libraryAssignee: Akira TAGOH <akira>
Status: RESOLVED FIXED QA Contact: Behdad Esfahbod <freedesktop>
Severity: normal    
Priority: medium CC: akira, bugs.freedesktop, fontconfig-bugs, fonts-bugs, freedesktop, mnowak
Version: 2.4   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Behdad Esfahbod 2008-07-23 11:37:41 UTC
If user sets fontformat in the match pattern, only fonts of the formats specified should be returned.  This doesn't seem to work right now:

$ fc-match -v  'sans:fontformat=bdf' | grep fontformat
	fontformat: "TrueType"(s)

$ fc-match -s -v  'sans:fontformat=bdf' | grep fontformat | sort -u
	fontformat: "BDF"(s)
	fontformat: "PCF"(s)
	fontformat: "TrueType"(s)
	fontformat: "Type 1"(s)

This is useful for apps like OO.o that can't handle CFF OpenType fonts.

Another thing brought up in the same thread in Fedora font list recently is, how does fontconfig prefer between fonts of the same family and version, but different type?  It should prefer CFF over TrueType over other stuff.  Is that how it works?  Or it's nondeterministic at this time?
Comment 1 Behdad Esfahbod 2008-12-28 12:52:33 UTC
FWIW, these are the elements set by fcfreetype.c that are not matched:

FC_SCALABLE
FC_FULLNAME
FC_CAPABILITY
FC_FONTFORMAT

I also tried breaking FC_CAPABILITY from one string into multiple ones, but seems like the cache only saves the first value for each element.
Comment 2 Behdad Esfahbod 2009-07-22 15:33:54 UTC
SCALABLE seems to be more useful.
Comment 3 Akira TAGOH 2011-09-05 18:02:30 UTC
Right now all the necessary information what the names of the element should be compared are hardcoded. is it maybe a good idea to export this sort of information into the external? this might possibly be easy to break fontconfig by mistake though, that would gives us the easy way to add the unknown/brand-new elements into fontconfig also, as long as the object is known in fontconfig.
Comment 4 Behdad Esfahbod 2013-08-13 15:13:28 UTC
Akira, do you also want to fix this perhaps?
Comment 5 Akira TAGOH 2013-08-14 02:57:31 UTC
Ah, yeah. will do that too.
Comment 6 Akira TAGOH 2013-08-15 02:47:55 UTC
added fontformat to the matcher.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.