diff options
author | marha <marha@users.sourceforge.net> | 2015-06-15 20:27:26 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2015-06-15 20:27:26 +0200 |
commit | e8d5e7c4bb11f7fcb0a4ba5c13f43e7929849a2f (patch) | |
tree | a88d66b3d34f8e008f08e2bd77889c6c6718ab11 /fontconfig/src/fcfreetype.c | |
parent | 0b3be550b20ad9f991f77bf979b2c306a7d4ef11 (diff) | |
download | vcxsrv-release/external.tar.gz vcxsrv-release/external.tar.bz2 vcxsrv-release/external.zip |
fontconfig libX11 libxcb xcb-proto mesa pixman xserver xkeyboard-config git update 15 June 2015release/external
xserver commit fa12f2c150b2f50de9dac4a2b09265f13af353af
libxcb commit f85661c3bca97faa72431df92a3867be39a74e23
libxcb/xcb-proto commit fef8a4cdc2cacd9541a656026371a3d338dadb8e
xkeyboard-config commit 61fb58a95a071cc1c212f6d3808908c086219fe0
libX11 commit f0286b2770ece10aef5e2e8c004260217f12fd25
pixman commit eebc1b78200aff075dbcae9c8d00edad1f830d91
fontconfig commit f6d61c9beed856a925bd60c025b55284b2d88161
mesa commit 932d1613d1e15ec22555e5ec09105c49eb850e36
Diffstat (limited to 'fontconfig/src/fcfreetype.c')
-rw-r--r-- | fontconfig/src/fcfreetype.c | 80 |
1 files changed, 58 insertions, 22 deletions
diff --git a/fontconfig/src/fcfreetype.c b/fontconfig/src/fcfreetype.c index afbd9ac1e..809ff2992 100644 --- a/fontconfig/src/fcfreetype.c +++ b/fontconfig/src/fcfreetype.c @@ -1199,7 +1199,8 @@ FcFreeTypeQueryFace (const FT_Face face, const char *tmp; FcRange *r = NULL; - double lower_size = 0.0L, upper_size = DBL_MAX; + + FcBool symbol = FcFalse; FcInitDebug (); /* We might be called with no initizalization whatsoever. */ @@ -1615,13 +1616,12 @@ FcFreeTypeQueryFace (const FT_Face face, #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; - } -#endif - if (os2) - { + r = FcRangeCreateDouble (lower_size, upper_size); if (!FcPatternAddRange (pat, FC_SIZE, r)) { @@ -1630,20 +1630,7 @@ FcFreeTypeQueryFace (const FT_Face face, } 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); - } - } +#endif /* * Type 1: Check for FontInfo dictionary information @@ -1803,6 +1790,11 @@ FcFreeTypeQueryFace (const FT_Face face, if (!cs) goto bail1; + /* The FcFreeTypeCharSetAndSpacing() chose the encoding; test it for symbol. */ + symbol = face->charmap && face->charmap->encoding == FT_ENCODING_MS_SYMBOL; + if (!FcPatternAddBool (pat, FC_SYMBOL, symbol)) + goto bail1; + #if HAVE_FT_GET_BDF_PROPERTY /* For PCF fonts, override the computed spacing with the one from the property */ @@ -1835,9 +1827,18 @@ FcFreeTypeQueryFace (const FT_Face face, if (!FcPatternAddCharSet (pat, FC_CHARSET, cs)) goto bail2; - ls = FcFreeTypeLangSet (cs, exclusiveLang); - if (!ls) - goto bail2; + if (!symbol) + { + ls = FcFreeTypeLangSet (cs, exclusiveLang); + if (!ls) + goto bail2; + } + else + { + /* Symbol fonts don't cover any language, even though they + * claim to support Latin1 range. */ + ls = FcLangSetCreate (); + } if (!FcPatternAddLangSet (pat, FC_LANG, ls)) { @@ -2093,6 +2094,22 @@ FcFreeTypeCharIndex (FT_Face face, FcChar32 ucs4) glyphindex = FT_Get_Char_Index (face, (FT_ULong) ucs4); if (glyphindex) return glyphindex; + if (ucs4 < 0x100 && face->charmap && + face->charmap->encoding == FT_ENCODING_MS_SYMBOL) + { + /* For symbol-encoded OpenType fonts, we duplicate the + * U+F000..F0FF range at U+0000..U+00FF. That's what + * Windows seems to do, and that's hinted about at: + * http://www.microsoft.com/typography/otspec/recom.htm + * under "Non-Standard (Symbol) Fonts". + * + * See thread with subject "Webdings and other MS symbol + * fonts don't display" on mailing list from May 2015. + */ + glyphindex = FT_Get_Char_Index (face, (FT_ULong) ucs4 + 0xF000); + if (glyphindex) + return glyphindex; + } } #if HAVE_FT_HAS_PS_GLYPH_NAMES /* @@ -2253,6 +2270,23 @@ FcFreeTypeCharSetAndSpacingForSize (FT_Face face, FcBlanks *blanks, int *spacing } ucs4 = FT_Get_Next_Char (face, ucs4, &glyph); } + if (fcFontEncodings[o] == FT_ENCODING_MS_SYMBOL) + { + /* For symbol-encoded OpenType fonts, we duplicate the + * U+F000..F0FF range at U+0000..U+00FF. That's what + * Windows seems to do, and that's hinted about at: + * http://www.microsoft.com/typography/otspec/recom.htm + * under "Non-Standard (Symbol) Fonts". + * + * See thread with subject "Webdings and other MS symbol + * fonts don't display" on mailing list from May 2015. + */ + for (ucs4 = 0xF000; ucs4 < 0xF100; ucs4++) + { + if (FcCharSetHasChar (fcs, ucs4)) + FcCharSetAddChar (fcs, ucs4 - 0xF000); + } + } #ifdef CHECK for (ucs4 = 0; ucs4 < 0x10000; ucs4++) { @@ -2267,6 +2301,8 @@ FcFreeTypeCharSetAndSpacingForSize (FT_Face face, FcBlanks *blanks, int *spacing } #endif } + + break; } #if HAVE_FT_HAS_PS_GLYPH_NAMES /* |