[OSX] Some words are placed on top of each other in complex text layout
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Nov 2014 18:55:08 +0000 (18:55 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Nov 2014 18:55:08 +0000 (18:55 +0000)
commit45f7659169203faf5bfca647a4103808f98c1ed5
tree266ec0af1728bbb366184e3d5299f3aa8ddab9d2
parent7139598dba8f8243240798b4f4cf89ea612593a5
[OSX] Some words are placed on top of each other in complex text layout
https://bugs.webkit.org/show_bug.cgi?id=138348

Reviewed by Simon Fraser.

Source/WebCore:

Some complex text layouts have lots of diacritics being placed all over the place.
CoreText sometimes compensates for this by adjusting the advances of the glyphs
throughout the string to make glyphs appear in the correct place. This means that
we can't naively cache the width of a space character; instead, we must obey
CoreText when it gives us an advance for a space.

Test: fast/text/large-space-width-complex.html

* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::adjustGlyphsAndAdvances):

LayoutTests:

Updating tests to not use cached space width.

* fast/text/large-space-width-complex-expected.html: Added.
* fast/text/large-space-width-complex.html: Added.
* fast/text/resources/NotoNastaliqUrduDraft.ttf: Added.
* platform/mac-mavericks/fast/text/emphasis-expected.png:
* platform/mac-mavericks/fast/text/emphasis-expected.txt: This test is orthogonal to space widths.
* platform/mac-mountainlion/fast/text/emphasis-expected.png:
* platform/mac-mountainlion/fast/text/emphasis-expected.txt:
* platform/mac/fast/text/emphasis-expected.png:
* platform/mac/fast/text/emphasis-expected.txt:
* platform/mac/fast/text/sticky-typesetting-features-expected.png:
* platform/mac/fast/text/sticky-typesetting-features-expected.txt: Ditto.
* platform/mac/fast/writing-mode/text-orientation-basic-expected.png:
* platform/mac/fast/writing-mode/text-orientation-basic-expected.txt: This test actually is improved with
this patch. Instead of a weirdly wide space width, the two words are spaced appropriately now.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@175813 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/text/large-space-width-complex-expected.html [new file with mode: 0644]
LayoutTests/fast/text/large-space-width-complex.html [new file with mode: 0644]
LayoutTests/fast/text/resources/NotoNastaliqUrduDraft.ttf [new file with mode: 0644]
LayoutTests/platform/mac-mavericks/fast/text/emphasis-expected.png [new file with mode: 0644]
LayoutTests/platform/mac-mavericks/fast/text/emphasis-expected.txt
LayoutTests/platform/mac-mountainlion/fast/text/emphasis-expected.png [new file with mode: 0644]
LayoutTests/platform/mac-mountainlion/fast/text/emphasis-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/fast/text/emphasis-expected.png
LayoutTests/platform/mac/fast/text/emphasis-expected.txt
LayoutTests/platform/mac/fast/text/sticky-typesetting-features-expected.png
LayoutTests/platform/mac/fast/text/sticky-typesetting-features-expected.txt
LayoutTests/platform/mac/fast/writing-mode/text-orientation-basic-expected.png
LayoutTests/platform/mac/fast/writing-mode/text-orientation-basic-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/mac/ComplexTextController.cpp