[Fontconfig] Matching fonts using xlfd where foundry name is unknown (unset?)

Andy Cordwell andy.cordwell at onelan.co.uk
Tue May 16 07:04:00 PDT 2006


Dear Fontconfig list,

I'm having problems using the same xlfd to match a font between X and FontConfig (v2.2.3),
for a font in which the foundry name is unknown (not set?).

If I call 'xlsfonts' to list all fonts, the foundry name for fonts with an unknown foundry 
is reported as 'misc' in the xlfd.  When this lfd is passed to X it returns the correct
font (as expected).  Passing the same xlfd to FontConfig results in a match against a 
different font.  The matched font has a foundry name explicitly set to 'Misc' (for example 
font 'console8x16').

I can reproduce this behavior if I run (JumBold is the family name of my sample font which
has an unrecognized font name):

xlsfonts -display :0.0 -fn -*-*-*-*-*--0-0-75-75-*-0-iso10646-1 | grep -i jumbold

which returns:
-misc-jumbold-medium-r-normal--0-0-75-75-p-0-iso10646-1

If I then search for this font using:

fc-list ":foundry=misc" : foundry family

Nothing is returned.  However, setting to 'foundry=unknown' will successfully return the 
font.

In a nutshell, X reports the foundry as 'misc' for fonts in which the foundry is
unknown, but FontConfig requires 'unknown' in the lfd to identify these same fonts.  As FC
treats a foundry match as a higher priority than the family match, this results in an 
incorrect match is foundry 'misc' is given.

Is the X / FontConfig behavior expected and correct?

I'm running FontConfig 2.2.3. on FedoraCore4.

Thanks,

~Andy



More information about the Fontconfig mailing list