If I want to list only fonts that have fontformat=TrueType or fontformat=CFF, currently I can't:
behdad:~ 0$ fc-list :fontformat=truetype,cff
This is because FcFontList interprets that as returning fonts that have both fontformat=truetype AND fontformat=cff. Code:
* Font must have a containing value for every value in the pattern
FcListValueListMatchAny (FcValueListPtr patOrig, /* pattern */
FcValueListPtr fntOrig) /* font */
FcValueListPtr pat, fnt;
for (pat = patOrig; pat != NULL; pat = FcValueListNext(pat))
for (fnt = fntOrig; fnt != NULL; fnt = FcValueListNext(fnt))
* make sure the font 'contains' the pattern.
* (OpListing is OpContains except for strings
* where it requires an exact match)
if (FcConfigCompareValue (&fnt->value,
FC_OP (FcOpListing, FcOpFlagIgnoreBlanks),
if (fnt == NULL)
I cannot imagine any scenario that this semantic is useful. I suggest we flip it from an AND to an OR.
What ops is preferred may depends on the context and property. I suppose OR op may be preferred for the unique value in a property like family. but both AND and OR might be for bitwise property like charset/lang. most properties has unique value. in this sense we could change the behavior but obvious syntax would needs to be added for AND.
(In reply to Akira TAGOH from comment #1)
> What ops is preferred may depends on the context and property. I suppose OR
> op may be preferred for the unique value in a property like family. but both
> AND and OR might be for bitwise property like charset/lang. most properties
> has unique value. in this sense we could change the behavior but obvious
> syntax would needs to be added for AND.
Both charset and lang keep multiple values in same element. The caller can create a charset/lang and add everything they want into it if AND is needed... I think just changing the behavior is fine to be honest.
-- GitLab Migration Automatic Message --
This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.
You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/5.