I was trying to use the Arial Narrow set of fonts but it would only ever show one and leave out the bold/italic variations. It would be easy enough for me to add them to type.xml, but that's not really a solution when things get promoted to user software.
Since I don't like unsolved mysteries, I started digging.
From the LoadFontConfigFonts function I found that ImageMagick creates its font name by concaternating the family and style strings. I did some tests with fontconfig, and it turns out that this combination is not guaranteed to be unique. For instance, for Arial Narrow the returned family is always "Arial" and the style is always "Narrow". Which is likely the source of the problem.
Since software like LibreOffice does present the font separate, I had a look at the fonts with fc-query as well. It turns out that these fonts have two (english) family names and style strings. "Arial" and "Narrow" which ImageMagick uses. And "Arial Narrow" and "Regular/Bold/...", which is the one more suitable for ImageMagick. I suppose the first set is for combining it with Arial as condensed width.
Fc-query also showed a simple solution to the problem. There is a 'fullname' property (FC_FULLNAME) that provides more complete names for all fonts that set it. Some checking revealed that it appears to be set for all TTF fonts to something close to family+style, but with full styles for fonts like Arial Narrow. The differences I noticed is that it adds a space to some family names and does not include "Regular" as a style. Although this is a small behaviour change, it's better than dropping fonts.
ImageMagick loses fonts supplied by FontConfig
Re: ImageMagick loses fonts supplied by FontConfig
We can reproduce the problem you posted and have a patch in ImageMagick 6.8.0-2 Beta available by sometime tomorrow. Thanks.
Re: ImageMagick loses fonts supplied by FontConfig
Thanks for the very quick response!
I checked the code in SVN and it looks like you forgot to add FC_FULLNAME in the FcObjectSetBuild line.
I checked the code in SVN and it looks like you forgot to add FC_FULLNAME in the FcObjectSetBuild line.
Re: ImageMagick loses fonts supplied by FontConfig
We had the the correct FcObjectSetBuild() call in our development environment but forgot to export it to SVN. Fixed now. Thanks.