Phil Race
2007-Aug-21 22:00 UTC
[Fontconfig] Problems caused by fontconfig eliding FC_FULLNAME.
Hello, fontconfig (2.4.2) elides the FC_FULLNAME from returned patterns when either FC_FULLNAME == FC_FAMILY or FC_FULLNAME = FC_FAMILY + FC_STYLE. The problem here is that seems impossible to decide which of these is the actual full name. Suppose we have FooFamily and it has the usual styles, then whilst the bold font is likely "FooFamily Bold", what about the regular font? The OT spec says its supposed to be the same as the family name - maybe that''s why fontconfig elides that case. So perhaps we could check the style and if its regular use the family name. But that''s already klunky and worse it depends on this actually being true. At one point the spec did not make this recommendation so you can find "Arial Regular" and "Lucida Sans Regular" in the real world. Also this selective eliding means that it causes problems in the [usual] case where fonts specify their names multiple times for each platform ID (Microsoft, Apple, etc). Eg: in this case we might have the Microsoft family, but the Apple (or other) full name : FCPatternGetString(pat, FC_FAMILY, 0, &family); FCPatternGetString(pat, FC_FULLNAME, 0, &fullname); i.e. if family name and full name match for ID == 0, but not for ID == 1 then the fullname will actually have been from pattern id=1, and now you have another problem. I''ve found at least one font (Rockwell MT Regular) that exposes this problem. So 1) I can''t reliably reconstitute full names from family + style 2) I can''t reliably trust that the fullname applies to the family of the same id. Any ideas on this? -Phil