This commit is contained in:
Behdad Esfahbod 2017-09-18 14:53:24 -04:00
parent 01f14de417
commit 7e1b84100d
1 changed files with 13 additions and 5 deletions

View File

@ -1764,13 +1764,21 @@ FcFreeTypeQueryFace (const FT_Face face,
lower_size = os2->usLowerOpticalPointSize / 20.0L;
upper_size = os2->usUpperOpticalPointSize / 20.0L;
r = FcRangeCreateDouble (lower_size, upper_size);
if (!FcPatternAddRange (pat, FC_SIZE, r))
if (lower_size == upper_size)
{
FcRangeDestroy (r);
goto bail1;
if (!FcPatternAddDouble (pat, FC_SIZE, lower_size))
goto bail1;
}
else
{
r = FcRangeCreateDouble (lower_size, upper_size);
if (!FcPatternAddRange (pat, FC_SIZE, r))
{
FcRangeDestroy (r);
goto bail1;
}
FcRangeDestroy (r);
}
FcRangeDestroy (r);
}
#endif