Write ranges using a [start finish) format

To show closed and open ends.
This commit is contained in:
Behdad Esfahbod 2014-07-04 16:09:23 -04:00
parent 4c9101f704
commit d09ba38589
2 changed files with 3 additions and 3 deletions

View File

@ -65,7 +65,7 @@ _FcValuePrintFile (FILE *f, const FcValue v)
break;
case FcTypeRange:
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;
}
}

View File

@ -316,7 +316,7 @@ FcNameConvert (FcType type, FcChar8 *string)
v.type = FcTypeVoid;
break;
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);
if (p != NULL && p[0] != 0)
@ -531,7 +531,7 @@ FcNameUnparseValue (FcStrBuf *buf,
if (FcDoubleCmpEQ (r.u.d.begin, r.u.d.end))
sprintf ((char *) temp, "%g", r.u.d.begin);
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);
}
else