[Fontconfig] FcPatternGet always gives font weight of '0'

Lucien Gentis lucien.gentis at waika9.com
Wed Sep 11 13:24:57 UTC 2019


I found the origin of the problem.

It's in XftFontOpenName function I use to generate an XftFont structure 
that contains an FcPattern.

FC_WEIGHT property of this FcPattern has type double instead of integer.

If I use:

FcPatternGet(font->pattern,FC_WEIGHT,0,&fcValue);

fcValue has type FcTypeDouble , and its value fcValue.u.d is 200,000 , 
that matches expected integer value for "bold" !

So it's not a fontconfig problem, it's an Xft one !

Thanks for reading

Lucien

Le 11/09/2019 à 01:35, Lawrence D'Oliveiro a écrit :
> On Tue, 10 Sep 2019 14:36:48 +0200, Lucien Gentis wrote:
>
>> So I tried to replace "Liberation Sans:style=Bold Italic" by
>> "Liberation Sans:weight=bold:slant=italic" in my C program, but under
>> Debian 10 , I still get:
>>
>> font family : Liberation Sans
>> font weight : 0
>> font slant : 100
>>
>> Family and slant are OK, only weight is false.
>>
>> Same program under Linux Ubuntu 18.04 gives :
>>
>> font family : Liberation Sans
>> font weight : 200
>> font slant : 100
> There was a version of Fontconfig that stopped recognizing “bold” as a
> value for the “weight” property for a while. I run Debian Unstable, and
> as I recall this did get fixed, but it looks like the previous version
> was left in Stable for version 10.
>
> As a workaround, try “weight=200” in your pattern.
> _______________________________________________
> Fontconfig mailing list
> Fontconfig at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/fontconfig


More information about the Fontconfig mailing list