diff options
author | marha <marha@users.sourceforge.net> | 2014-03-28 17:43:20 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-03-28 17:43:20 +0100 |
commit | f0f09f4aa3cdd0267f58b362a7c9fc5ae0921afd (patch) | |
tree | afbeb028495328a2817aedbac7aae484a2c71a83 /fontconfig/src/fcfreetype.c | |
parent | bf0cbcc1d00962ef2221cb4ceae87cc5ae737454 (diff) | |
parent | cbfb19790917d271b8ca6156554b16acc802719f (diff) | |
download | vcxsrv-f0f09f4aa3cdd0267f58b362a7c9fc5ae0921afd.tar.gz vcxsrv-f0f09f4aa3cdd0267f58b362a7c9fc5ae0921afd.tar.bz2 vcxsrv-f0f09f4aa3cdd0267f58b362a7c9fc5ae0921afd.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
X11/xtrans/Xtrans.c
Diffstat (limited to 'fontconfig/src/fcfreetype.c')
-rw-r--r-- | fontconfig/src/fcfreetype.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/fontconfig/src/fcfreetype.c b/fontconfig/src/fcfreetype.c index 97d049206..988913ba2 100644 --- a/fontconfig/src/fcfreetype.c +++ b/fontconfig/src/fcfreetype.c @@ -1107,6 +1107,8 @@ FcFreeTypeQueryFace (const FT_Face face, FcChar8 *hashstr = NULL; FT_Error err; FT_ULong len = 0, alen; + FcRange *r = NULL; + double lower_size = 0.0L, upper_size = DBL_MAX; pat = FcPatternCreate (); if (!pat) @@ -1514,6 +1516,39 @@ 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)) + { + FcRangeDestroy (r); + goto bail1; + } + FcRangeDestroy (r); + } + else + { + for (i = 0; i < face->num_fixed_sizes; i++) + { + double d = FcGetPixelSize (face, i); + r = FcRangeCreateDouble (d, d); + if (!FcPatternAddRange (pat, FC_SIZE, r)) + { + FcRangeDestroy (r); + goto bail1; + } + FcRangeDestroy (r); + } + } + /* * Type 1: Check for FontInfo dictionary information * Code from g2@magestudios.net (Gerard Escalante) |