Bug 37 - Matching failed when Fixed and Onyx fonts are in separate directories
Summary: Matching failed when Fixed and Onyx fonts are in separate directories
Alias: None
Product: fontconfig
Classification: Unclassified
Component: library (show other bugs)
Version: 2.1
Hardware: x86 (IA32) Linux (All)
: high critical
Assignee: Keith Packard
QA Contact:
Depends on:
Reported: 2003-02-26 06:57 UTC by Frederic Crozat
Modified: 2003-02-25 16:15 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

log from FC_DEBUG=127 xterm -fa sans (16.00 KB, text/plain)
2003-02-26 07:52 UTC, Frederic Crozat
log from gedit with FC_DEBUG=127 (12.55 KB, text/plain)
2003-02-26 08:41 UTC, Frederic Crozat

Description Frederic Crozat 2003-02-26 06:57:00 UTC
This bug is present in fontconfig 2.0, 2.1 and CVS :

-configure fontconfig to only use 2 different directories (foo and bar)
-in foo directory, put 4x6-ISO8859-1.pcf font (ucs font from XF 4.3 CVS)
-in bar directory, put onyx.ttf font (Linotype Onyx from

-run fc-cache -f -v  to refresh fontconfig cache

now, run xterm -fa sans => crash in FcPatternPosition (p=0x0, object=0x4002363b
"file) at fcpat.c:535
535 high = p->num - 1;

This is caused by fontconfig matching code returning a Null match

If you try to start a pango based application, you get the "fonconfig is not

Moving onyx.ttf font in the "foo" directory and restarting fc-cache fixes the

The issue described here is a simplified testcase.. More simply, you just need
to add onyx.ttf font in a directory different from the one which contains
4x6-ISO8859-1 to break fontconfig :((
Comment 1 Frederic Crozat 2003-02-26 07:52:51 UTC
Created attachment 24 [details]
log from FC_DEBUG=127 xterm -fa sans
Comment 2 Keith Packard 2003-02-26 08:27:30 UTC
Looks like the attachment was truncated at the critical juncture.  Given that
the onyx font is not redistributable, I'm afraid we're going to have a difficult
time debugging this.  Have you tried reproducing this with a free font?  I
suggest that one of the issues is related to the lack of French support in 4x6,
so it may be that most any .ttf which does support french will cause a similar
Comment 3 Frederic Crozat 2003-02-26 08:40:24 UTC
This doesn't seem to be related to french locale => I've reconfigured the system
to use english and I still get the same problem..

Attached is another log obtained with gedit.. There is no crash involved since
pango returns an error and log shouldn't be truncated
Comment 4 Frederic Crozat 2003-02-26 08:41:14 UTC
Created attachment 25 [details]
log from gedit with FC_DEBUG=127
Comment 5 Keith Packard 2003-02-26 11:15:58 UTC
Cool bug.  The reason 4x6 was critical was that onyx has a font version of 6 and
4x6 has a pixelsize of 6.  The pixel size was represented internally as a value
list containing '6.0' and was parsed first.  When onyx was parsed, it shared the
same value list as 6 == 6.0.  However, the matching code didn't allow integer
and double values to mix, the result was a match failure.

Fixed by permitting double and integer values to mix in the matching code.

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.