From cbfb19790917d271b8ca6156554b16acc802719f Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 28 Mar 2014 17:35:36 +0100 Subject: libxtrans fontconfig mesa xserver git update 28 Mar 2014 xserver commit a2880699e8f1f576e1a48ebf25e8982463323f84 libxtrans commit 68f60238c4224f954ff6556ae778c72e420175f0 fontconfig commit fcba9ef01c978323fc71c17e455d3cd6ae35edcc mesa commit 029ccd773d01a5f801c809c499516d7b0c4cc3f8 --- fontconfig/src/fcfreetype.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'fontconfig/src/fcfreetype.c') diff --git a/fontconfig/src/fcfreetype.c b/fontconfig/src/fcfreetype.c index d271d69e2..d0932b31b 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) -- cgit v1.2.3