Matching a patern with FC_SLANT_ITALIC returns a different result than the same query if done with a FC_STYLE="Italic". On a system with only two fonts (or a stock Redhat8.0 system with all of its fonts): /usr/X11R6/lib/X11/fonts/Type1/l048013t.pfa /usr/X11R6/lib/X11/fonts/Type1/l048033t.pfa with the default /etc/fonts/fonts.conf file from RedHat 8.0 returns a different result with the attached code. "Oblique" is not closer than "Regular" to "Italic" if matched with strings, with integers the expected behaviour occurs. Sample code attached. When ran, I get this results: [chema@lamark bug]$ ./sample 1: /usr/X11R6/lib/X11/fonts/Type1/l048013t.pfa 2: /usr/X11R6/lib/X11/fonts/Type1/l048033t.pfa [chema@lamark bug]$ I've worked around this bug on my code and I don't need the fix since it seems better to me to match by integers anyways, but I still wanted to file the bug.
Created attachment 10 [details] sample code
FC_STYLE is nominally informative rather than instructive; attempting to perform any kind of string "nearness" metric from the range of possible font styles seems impractical.
Then it might be a documentation bug. man fontconfig says: style FC_STYLE String Font style. Overrides weight and slant reopen?
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.