<rdar://problem/10191243> Glyph variants (line final swashes) appear where they shoul...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Sep 2011 20:21:02 +0000 (20:21 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Sep 2011 20:21:02 +0000 (20:21 +0000)
commit83852396e1dec4acdd336f2a8c8b58d536ccb0aa
tree46f35821503fe19b93e222ade307ea4a4710eb8a
parent9d102fb74595cb07b944131c4cb0a194af9d5763
<rdar://problem/10191243> Glyph variants (line final swashes) appear where they should not

Reviewed by Simon Fraser.

Source/WebCore:

Test: fast/text/line-initial-and-final-swashes.html

Hoefler Text Italic enables line-initial and -final swashes by default, so disable them. This
change targets only this known-bad font rather than all fonts, because at least one font (Khmer MN)
incorrectly claims to have the line-initial feature enabled, but disabling it actually does
something different and bad (breaking some combining marks).

* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::createFeatureSettingDictionary): Added this helper function.
(WebCore::cascadeToLastResortFontDescriptor): Deployed WTF_ARRAY_LENGTH().
(WebCore::cascadeToLastResortAndDisableSwashesFontDescriptor): Added. Returns a font descriptor
that, in addition to having a cascade list consisting of the last resort font, also has feature
settings to disable line-initial and line-final swashes.
(WebCore::FontPlatformData::ctFont): For Hoefler Text Italic, use cascadeToLastResortAndDisableSwashesFontDescriptor().

LayoutTests:

* fast/text/line-initial-and-final-swashes.html: Added.
* platform/mac/fast/text/line-initial-and-final-swashes-expected.png: Added.
* platform/mac/fast/text/line-initial-and-final-swashes-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96351 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/text/line-initial-and-final-swashes.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/text/line-initial-and-final-swashes-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/text/line-initial-and-final-swashes-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm