Comment 115 for bug 105900

Revision history for this message
In , Pgajdos-f (pgajdos-f) wrote :

However, this is not related to this bug at all. I will try explain, what I have found and what would help in my opinion.

First, for each font we have defined four lists:
FAMILY .. family name in different languages
FAMILYLANG .. languages corresponding to entries in FAMILY
STYLE .. style name in different languages
STYLELANG .. languages corresponding to entries in STYLE

As far as I can see, STYLE and STYLELANG are handled in fontconfig similar way as FAMILY and FAMILYLANG respectively. But, these two pairs are handled differently by Office:

FcResult eFamilyRes = rWrapper.FamilyFromPattern( pFSet->fonts[i], &family );
FcResult eStyleRes = rWrapper.FcPatternGetString( pFSet->fonts[i], FC_STYLE, 0, &style );

This is in my opinion wrong, because I believe FamilyFromPattern() chooses the name in right language, but FcPatternGetString(..,FC_STYLE,0,..) takes the _first_ element from the list.

If all from the above is true, then all what remains is to implement StyleFromPattern() function (very similar to FamilyFromPattern()) and change one line in countFontconfigFonts().

Could someone with better experience with Office patching and building to try this out?