summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2014-07-04 16:13:45 -0400
committerBehdad Esfahbod <behdad@behdad.org>2015-05-27 14:12:49 -0700
commit51756aab180c9f7a6632743885695add2f511100 (patch)
treed22f03b43fc7ad02345dfd9e93937a2d348a35c9 /src
parentd09ba385892862e18c409f49405f51f066dea552 (diff)
Only set FC_SIZE for scalable fonts if OS/2 version 5 is present
Part of https://bugs.freedesktop.org/show_bug.cgi?id=80873
Diffstat (limited to 'src')
-rw-r--r--src/fcfreetype.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/fcfreetype.c b/src/fcfreetype.c
index 617b6b9..31bff8f 100644
--- a/src/fcfreetype.c
+++ b/src/fcfreetype.c
@@ -1199,7 +1199,6 @@ FcFreeTypeQueryFace (const FT_Face face,
const char *tmp;
FcRange *r = NULL;
- double lower_size = 0.0L, upper_size = DBL_MAX;
FcBool symbol = FcFalse;
@@ -1614,23 +1613,26 @@ FcFreeTypeQueryFace (const FT_Face face,
free (complex_);
}
-#if defined (HAVE_TT_OS2_USUPPEROPTICALPOINTSIZE) && defined (HAVE_TT_OS2_USLOWEROPTICALPOINTSIZE)
- if (os2 && os2->version >= 0x0005 && os2->version != 0xffff)
- {
- /* usLowerPointSize and usUpperPointSize is actually twips */
- lower_size = os2->usLowerOpticalPointSize / 20.0L;
- upper_size = os2->usUpperOpticalPointSize / 20.0L;
- }
-#endif
if (os2)
{
- r = FcRangeCreateDouble (lower_size, upper_size);
- if (!FcPatternAddRange (pat, FC_SIZE, r))
+#if defined (HAVE_TT_OS2_USUPPEROPTICALPOINTSIZE) && defined (HAVE_TT_OS2_USLOWEROPTICALPOINTSIZE)
+ if (os2 && os2->version >= 0x0005 && os2->version != 0xffff)
{
+ double lower_size, upper_size;
+
+ /* usLowerPointSize and usUpperPointSize is actually twips */
+ lower_size = os2->usLowerOpticalPointSize / 20.0L;
+ upper_size = os2->usUpperOpticalPointSize / 20.0L;
+
+ r = FcRangeCreateDouble (lower_size, upper_size);
+ if (!FcPatternAddRange (pat, FC_SIZE, r))
+ {
+ FcRangeDestroy (r);
+ goto bail1;
+ }
FcRangeDestroy (r);
- goto bail1;
}
- FcRangeDestroy (r);
+#endif
}
else
{