/*
- * $XFree86: xc/lib/fontconfig/src/fccfg.c,v 1.5 2002/03/01 01:00:54 keithp Exp $
+ * $XFree86: xc/lib/fontconfig/src/fccfg.c,v 1.11 2002/06/08 17:32:04 keithp Exp $
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
*
}
else if (v.type == FcTypeVoid && u.type == FcTypeMatrix)
{
- v.u.m = (FcMatrix *) &FcIdentityMatrix;
- v.type = FcTypeMatrix;
+ v.u.m = FcMatrixCopy (&FcIdentityMatrix);
+ if (v.u.m)
+ v.type = FcTypeMatrix;
}
return v;
}
case FcTypeCharSet:
switch (op) {
case FcOpContains:
- /* m contains v if v - m is empty */
- ret = FcCharSetSubtractCount (v.u.c, m.u.c) == 0;
+ /* m contains v if v is a subset of m */
+ ret = FcCharSetIsSubset (v.u.c, m.u.c);
break;
case FcOpEqual:
ret = FcCharSetEqual (m.u.c, v.u.c);
break;
}
break;
+ case FcTypeFTFace:
+ switch (op) {
+ case FcOpEqual:
+ ret = m.u.f == v.u.f;
+ break;
+ case FcOpNotEqual:
+ ret = m.u.f != v.u.f;
+ break;
+ default:
+ break;
+ }
}
}
else
case FcTypeCharSet:
switch (e->op) {
case FcOpContains:
- /* vl contains vr if vr - vl is empty */
+ /* vl contains vr if vr is a subset of vl */
v.type = FcTypeBool;
- v.u.b = FcCharSetSubtractCount (vr.u.c, vl.u.c) == 0;
+ v.u.b = FcCharSetIsSubset (vr.u.c, vl.u.c);
break;
case FcOpEqual:
v.type = FcTypeBool;
static FcValueList *
FcConfigMatchValueList (FcPattern *p,
FcTest *t,
- FcValueList *v)
+ FcValueList *values)
{
FcValueList *ret = 0;
FcExpr *e = t->expr;
FcValue value;
+ FcValueList *v;
while (e)
{
e = 0;
}
- for (; v; v = v->next)
+ for (v = values; v; v = v->next)
{
if (FcConfigCompareValue (v->value, t->op, value))
{
}
}
}
+ FcValueDestroy (value);
}
- FcValueDestroy (value);
return ret;
}
{
if (list)
{
- FcPatternElt *e = FcPatternFind (p, object, FcTrue);
+ FcPatternElt *e = FcPatternInsertElt (p, object);
if (!e)
return;
FcConfigPatternDel (FcPattern *p,
const char *object)
{
- FcPatternElt *e = FcPatternFind (p, object, FcFalse);
+ FcPatternElt *e = FcPatternFindElt (p, object);
if (!e)
return;
while (e->values)
FcConfigPatternCanon (FcPattern *p,
const char *object)
{
- FcPatternElt *e = FcPatternFind (p, object, FcFalse);
+ FcPatternElt *e = FcPatternFindElt (p, object);
if (!e)
return;
if (!e->values)
printf ("FcConfigSubstitute test ");
FcTestPrint (t);
}
- st[i].elt = FcPatternFind (p, t->field, FcFalse);
+ st[i].elt = FcPatternFindElt (p, t->field);
/*
* If there's no such field in the font,
* then FcQualAll matches while FcQualAny does not
st[i].value = FcConfigMatchValueList (p, t, st[i].elt->values);
if (!st[i].value)
break;
+ if (t->qual == FcQualFirst && st[i].value != st[i].elt->values)
+ break;
+ if (t->qual == FcQualNotFirst && st[i].value == st[i].elt->values)
+ break;
}
if (t)
{