<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - FcFontList "contain" semantics unproductive"
href="https://bugs.freedesktop.org/show_bug.cgi?id=107246">107246</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>FcFontList "contain" semantics unproductive
</td>
</tr>
<tr>
<th>Product</th>
<td>fontconfig
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>library
</td>
</tr>
<tr>
<th>Assignee</th>
<td>fontconfig-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>freedesktop@behdad.org
</td>
</tr>
<tr>
<th>QA Contact</th>
<td>freedesktop@behdad.org
</td>
</tr></table>
<p>
<div>
<pre>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
Returns empty.
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
*/
static FcBool
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),
&pat->value))
break;
}
if (fnt == NULL)
return FcFalse;
}
return FcTrue;
}
I cannot imagine any scenario that this semantic is useful. I suggest we flip
it from an AND to an OR.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>