Changeset 175813 in webkit


Ignore:
Timestamp:
Nov 10, 2014, 10:55:08 AM (11 years ago)
Author:
mmaxfield@apple.com
Message:

[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.

Location:
trunk
Files:
5 added
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r175809 r175813  
     12014-11-10  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        [OSX] Some words are placed on top of each other in complex text layout
     4        https://bugs.webkit.org/show_bug.cgi?id=138348
     5
     6        Reviewed by Simon Fraser.
     7
     8        Updating tests to not use cached space width.
     9
     10        * fast/text/large-space-width-complex-expected.html: Added.
     11        * fast/text/large-space-width-complex.html: Added.
     12        * fast/text/resources/NotoNastaliqUrduDraft.ttf: Added.
     13        * platform/mac-mavericks/fast/text/emphasis-expected.png:
     14        * platform/mac-mavericks/fast/text/emphasis-expected.txt: This test is orthogonal to space widths.
     15        * platform/mac-mountainlion/fast/text/emphasis-expected.png:
     16        * platform/mac-mountainlion/fast/text/emphasis-expected.txt:
     17        * platform/mac/fast/text/emphasis-expected.png:
     18        * platform/mac/fast/text/emphasis-expected.txt:
     19        * platform/mac/fast/text/sticky-typesetting-features-expected.png:
     20        * platform/mac/fast/text/sticky-typesetting-features-expected.txt: Ditto.
     21        * platform/mac/fast/writing-mode/text-orientation-basic-expected.png:
     22        * platform/mac/fast/writing-mode/text-orientation-basic-expected.txt: This test actually is improved with
     23        this patch. Instead of a weirdly wide space width, the two words are spaced appropriately now.
     24
    1252014-11-10  Csaba Osztrogonác  <ossy@webkit.org>
    226
  • trunk/LayoutTests/platform/mac-mavericks/fast/text/emphasis-expected.txt

    r174585 r175813  
    2626          RenderText {#text} at (3,45) size 217x28
    2727            text run at (3,45) width 217: "consectetur adipiscing"
    28         RenderText {#text} at (220,45) size 135x28
     28        RenderText {#text} at (220,45) size 134x28
    2929          text run at (220,45) width 6: " "
    30           text run at (226,45) width 129: "elit. Aliquam"
     30          text run at (226,45) width 128: "elit. Aliquam"
    3131        RenderInline {SPAN} at (0,0) size 111x28
    3232          RenderText {#text} at (3,73) size 111x28
  • trunk/LayoutTests/platform/mac-mountainlion/fast/text/emphasis-expected.txt

    r175812 r175813  
    2626          RenderText {#text} at (3,45) size 217x28
    2727            text run at (3,45) width 217: "consectetur adipiscing"
    28         RenderText {#text} at (220,45) size 135x28
     28        RenderText {#text} at (220,45) size 134x28
    2929          text run at (220,45) width 6: " "
    30           text run at (226,45) width 129: "elit. Aliquam"
     30          text run at (226,45) width 128: "elit. Aliquam"
    3131        RenderInline {SPAN} at (0,0) size 111x28
    3232          RenderText {#text} at (3,73) size 111x28
  • trunk/LayoutTests/platform/mac/fast/text/emphasis-expected.txt

    r174585 r175813  
    2626          RenderText {#text} at (3,45) size 217x28
    2727            text run at (3,45) width 217: "consectetur adipiscing"
    28         RenderText {#text} at (220,45) size 135x28
     28        RenderText {#text} at (220,45) size 134x28
    2929          text run at (220,45) width 6: " "
    30           text run at (226,45) width 129: "elit. Aliquam"
     30          text run at (226,45) width 128: "elit. Aliquam"
    3131        RenderInline {SPAN} at (0,0) size 111x28
    3232          RenderText {#text} at (3,73) size 111x28
  • trunk/LayoutTests/platform/mac/fast/text/sticky-typesetting-features-expected.txt

    r129389 r175813  
    1414          text run at (0,0) width 324: "This should be rendered with kerning and ligatures:"
    1515      RenderBlock {DIV} at (0,250) size 784x166
    16         RenderText {#text} at (0,0) size 754x166
    17           text run at (0,0) width 754: "Office Today"
     16        RenderText {#text} at (0,0) size 751x166
     17          text run at (0,0) width 751: "Office Today"
  • trunk/LayoutTests/platform/mac/fast/writing-mode/text-orientation-basic-expected.txt

    r129389 r175813  
    5050              text run at (94,1) width 197: "Hello world"
    5151          RenderBR {BR} at (112,198) size 0x0
    52           RenderInline {SPAN} at (0,0) size 36x221
    53             RenderText {#text} at (148,1) size 36x221
    54               text run at (148,1) width 221: "Hello world"
    55           RenderBR {BR} at (166,222) size 0x0
     52          RenderInline {SPAN} at (0,0) size 36x197
     53            RenderText {#text} at (148,1) size 36x197
     54              text run at (148,1) width 197: "Hello world"
     55          RenderBR {BR} at (166,198) size 0x0
    5656        RenderText {#text} at (0,0) size 0x0
  • trunk/Source/WebCore/ChangeLog

    r175812 r175813  
     12014-11-10  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        [OSX] Some words are placed on top of each other in complex text layout
     4        https://bugs.webkit.org/show_bug.cgi?id=138348
     5
     6        Reviewed by Simon Fraser.
     7
     8        Some complex text layouts have lots of diacritics being placed all over the place.
     9        CoreText sometimes compensates for this by adjusting the advances of the glyphs
     10        throughout the string to make glyphs appear in the correct place. This means that
     11        we can't naively cache the width of a space character; instead, we must obey
     12        CoreText when it gives us an advance for a space.
     13
     14        Test: fast/text/large-space-width-complex.html
     15
     16        * platform/graphics/mac/ComplexTextController.cpp:
     17        (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
     18
    1192014-11-10  Eric Carlson  <eric.carlson@apple.com>
    220
  • trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp

    r174858 r175813  
    618618            bool treatAsSpace = Font::treatAsSpace(ch);
    619619            CGGlyph glyph = treatAsSpace ? fontData->spaceGlyph() : glyphs[i];
    620             CGSize advance = treatAsSpace ? CGSizeMake(spaceWidth, advances[i].height) : advances[i];
     620            CGSize advance = advances[i];
    621621#if PLATFORM(IOS)
    622622            if (isEmoji && advance.width)
Note: See TracChangeset for help on using the changeset viewer.