[Fontconfig] FcPatternGetInteger does not yield a weight for some entries in multi-weight .ttf

Sean Whitton spwhitton at spwhitton.name
Wed Jan 5 01:03:32 UTC 2022


Hello Akira,

On Mon 03 Jan 2022 at 01:46PM +09, Akira TAGOH wrote:

> Some variable fonts supports multiple weights and fontconfig returns a
> weight property in Range as the base pattern which is a sort of the virtual
> entry and has "true" in variable property. If you want to traverse all the
> fonts patterns and do something in the own way, you have to use
> FcPatternGetRange in such case. otherwise fontconfig returns a proper
> pattern according to the request (with FcFontMatch).

Thank you for the reply.  Very helpful.

For Inconsolata-VariableFont_wdth,wght.ttf, I was able to call
FcPatternGetRange on the FcPattern that is causing trouble, and I
confirmed that the weights of all the other FcPatterns from the file
fall within the beginning and end of that range.

However, if I call FcPatternGetBool on the pattern for the FC_VARIABLE
property, I get FcResultNoMatch -- what does that mean?

Thanks again.

-- 
Sean Whitton


More information about the Fontconfig mailing list