Write ranges using a [start finish) format
To show closed and open ends.
This commit is contained in:
parent
4c9101f704
commit
d09ba38589
|
@ -65,7 +65,7 @@ _FcValuePrintFile (FILE *f, const FcValue v)
|
||||||
break;
|
break;
|
||||||
case FcTypeRange:
|
case FcTypeRange:
|
||||||
r = FcRangeCanonicalize (v.u.r);
|
r = FcRangeCanonicalize (v.u.r);
|
||||||
fprintf (f, "(%g, %g)", r.u.d.begin, r.u.d.end);
|
fprintf (f, "[%g %g)", r.u.d.begin, r.u.d.end);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -316,7 +316,7 @@ FcNameConvert (FcType type, FcChar8 *string)
|
||||||
v.type = FcTypeVoid;
|
v.type = FcTypeVoid;
|
||||||
break;
|
break;
|
||||||
case FcTypeRange:
|
case FcTypeRange:
|
||||||
if (sscanf ((char *) string, "(%lg %lg)", &b, &e) != 2)
|
if (sscanf ((char *) string, "[%lg %lg)", &b, &e) != 2)
|
||||||
{
|
{
|
||||||
v.u.d = strtod ((char *) string, &p);
|
v.u.d = strtod ((char *) string, &p);
|
||||||
if (p != NULL && p[0] != 0)
|
if (p != NULL && p[0] != 0)
|
||||||
|
@ -531,7 +531,7 @@ FcNameUnparseValue (FcStrBuf *buf,
|
||||||
if (FcDoubleCmpEQ (r.u.d.begin, r.u.d.end))
|
if (FcDoubleCmpEQ (r.u.d.begin, r.u.d.end))
|
||||||
sprintf ((char *) temp, "%g", r.u.d.begin);
|
sprintf ((char *) temp, "%g", r.u.d.begin);
|
||||||
else
|
else
|
||||||
sprintf ((char *) temp, "(%g %g)", r.u.d.begin, r.u.d.end);
|
sprintf ((char *) temp, "[%g %g)", r.u.d.begin, r.u.d.end);
|
||||||
return FcNameUnparseString (buf, temp, 0);
|
return FcNameUnparseString (buf, temp, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue