<rdar://problem/9528843> STIX glyphs not rendered on this stackoverflow answer
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Sep 2011 22:32:43 +0000 (22:32 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Sep 2011 22:32:43 +0000 (22:32 +0000)
commit5c0965d6a07ed9db0a12cc913841c47991cb071d
treed63baafd9a3d19c9550690b2fb70a794b341cc45
parent6c26ed18552c7ed122b69d5c46647a327c01685e
<rdar://problem/9528843> STIX glyphs not rendered on this stackoverflow answer
https://bugs.webkit.org/show_bug.cgi?id=67444

Reviewed by Darin Adler.

Source/WebCore:

Test: fast/text/fallback-traits-fixup.html

After obtaining STIX Regular as a fallback font for some characters, getFontDataForCharacters()
proceeded to ask for a font from the same family having the desired traits and weight (because
wkGetFontInLanguageForRange() does not preserve traits and weight). The returned font was different
and happened to not contain the desired character.

* platform/graphics/mac/FontCacheMac.mm:
(WebCore::FontCache::getFontDataForCharacters): Only ask for a family member with the desired
traits and weight if the substitute font does not already have them, and only use the returned
member if it actually contains the desired character.

LayoutTests:

* fast/text/fallback-traits-fixup.html: Added.
* platform/mac/fast/text/fallback-traits-fixup-expected.png: Added.
* platform/mac/fast/text/fallback-traits-fixup-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94352 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/text/fallback-traits-fixup.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/text/fallback-traits-fixup-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/text/fallback-traits-fixup-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/mac/FontCacheMac.mm