[Fontconfig] Pattern Matching Issues

Behdad Esfahbod behdad at behdad.org
Fri Jan 31 07:53:46 PST 2014

On 14-01-30 09:26 PM, Akira TAGOH wrote:
> On Fri, Jan 31, 2014 at 4:27 AM, Behdad Esfahbod <behdad at behdad.org> wrote:
>> The problem is that in fcfreetype.c, we only set FC_SPACING on the font if
>> it's not FC_PROPORTIONAL.  Then when matching, if the font pattern doesn't
>> have FC_SPACING, it is an implicit match.  Ouch!  I think we should fix the
>> first part.  I'm sure there was a reason for it (broken fonts, etc?).  But I
>> think we should fix it now.  Here's the relevant part of fcfreetype.c:
>>     if (spacing != FC_PROPORTIONAL)
>>         if (!FcPatternAddInteger (pat, FC_SPACING, spacing))
>>             goto bail2;
> The reason may be true. but I have no idea what the font it was. we
> may need to figure out the side-effect on this change in advance.
> Aside from that, we should add a test case to check if targeted
> parameters on matcher is surely available after scanning. or having a
> trick for those missing parameters on matcher and ignore it. later one
> might be more robust for incompatibility on matcher in the future
> perhaps.

Sure that would be good long term.  But in this case, not setting
FC_PROPORTIONAL totally breaks any use of this property.

Indeed, we want to be able to match monospace fonts.  We should do that in vte
for example.


More information about the Fontconfig mailing list