Changeset 96404 in webkit


Ignore:
Timestamp:
Sep 30, 2011 10:05:22 AM (13 years ago)
Author:
mitz@apple.com
Message:

Complex spaces with synthetic bold are too wide
https://bugs.webkit.org/show_bug.cgi?id=69033

Patch by Ned Holbrook <nholbrook@apple.com> on 2011-09-30
Reviewed by Dan Bernstein.

Source/WebCore:

Test: fast/text/complex-synthetic-bold-space-width.html

  • platform/graphics/mac/ComplexTextController.cpp:

(WebCore::ComplexTextController::adjustGlyphsAndAdvances): Subtract synthetic bold offset from spaceWidth.

  • platform/graphics/win/UniscribeController.cpp:

(WebCore::UniscribeController::shapeAndPlaceItem): Ditto.

LayoutTests:

  • fast/text/complex-synthetic-bold-space-width.html: Added.
  • platform/mac/fast/text/atsui-multiple-renderers-expected.png:
  • platform/mac/fast/text/atsui-multiple-renderers-expected.txt:
  • platform/mac/fast/text/complex-synthetic-bold-space-width-expected.png: Added.
  • platform/mac/fast/text/complex-synthetic-bold-space-width-expected.txt: Added.
Location:
trunk
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r96403 r96404  
     12011-09-30  Ned Holbrook  <nholbrook@apple.com>
     2
     3        Complex spaces with synthetic bold are too wide
     4        https://bugs.webkit.org/show_bug.cgi?id=69033
     5
     6        Reviewed by Dan Bernstein.
     7
     8        * fast/text/complex-synthetic-bold-space-width.html: Added.
     9        * platform/mac/fast/text/atsui-multiple-renderers-expected.png:
     10        * platform/mac/fast/text/atsui-multiple-renderers-expected.txt:
     11        * platform/mac/fast/text/complex-synthetic-bold-space-width-expected.png: Added.
     12        * platform/mac/fast/text/complex-synthetic-bold-space-width-expected.txt: Added.
     13
    1142011-09-30  Antaryami Pandia  <antaryami.pandia@motorola.com>
    215
  • trunk/LayoutTests/platform/mac/fast/text/atsui-multiple-renderers-expected.txt

    r78867 r96404  
    3636          RenderTableRow {TR} at (0,30) size 262x30
    3737            RenderTableCell {TD} at (0,30) size 131x30 [border: (1px solid #008000)] [r=1 c=0 rs=1 cs=1]
    38               RenderText {#text} at (2,3) size 76x25
    39                 text run at (2,3) width 76: "Lore\x{300}m "
     38              RenderText {#text} at (2,3) size 75x25
     39                text run at (2,3) width 75: "Lore\x{300}m "
    4040              RenderInline {SPAN} at (0,0) size 53x23
    41                 RenderText {#text} at (78,5) size 53x23
    42                   text run at (78,5) width 53: "ipsu\x{308}m"
     41                RenderText {#text} at (77,5) size 53x23
     42                  text run at (77,5) width 53: "ipsu\x{308}m"
    4343              RenderText {#text} at (0,0) size 0x0
    4444            RenderTableCell {TD} at (131,30) size 131x30 [border: (1px solid #008000)] [r=1 c=1 rs=1 cs=1]
     
    6666          RenderTableRow {TR} at (0,90) size 262x30
    6767            RenderTableCell {TD} at (0,90) size 131x30 [border: (1px solid #008000)] [r=3 c=0 rs=1 cs=1]
    68               RenderText {#text} at (2,3) size 76x25
    69                 text run at (2,3) width 76: "Lore\x{300}m "
     68              RenderText {#text} at (2,3) size 75x25
     69                text run at (2,3) width 75: "Lore\x{300}m "
    7070              RenderInline {SPAN} at (0,0) size 51x23
    71                 RenderText {#text} at (78,5) size 51x23
    72                   text run at (78,5) width 51: "ipsu\x{308}m"
     71                RenderText {#text} at (77,5) size 51x23
     72                  text run at (77,5) width 51: "ipsu\x{308}m"
    7373              RenderText {#text} at (0,0) size 0x0
    7474            RenderTableCell {TD} at (131,90) size 131x30 [border: (1px solid #008000)] [r=3 c=1 rs=1 cs=1]
  • trunk/Source/WebCore/ChangeLog

    r96398 r96404  
     12011-09-30  Ned Holbrook  <nholbrook@apple.com>
     2
     3        Complex spaces with synthetic bold are too wide
     4        https://bugs.webkit.org/show_bug.cgi?id=69033
     5
     6        Reviewed by Dan Bernstein.
     7
     8        Test: fast/text/complex-synthetic-bold-space-width.html
     9
     10        * platform/graphics/mac/ComplexTextController.cpp:
     11        (WebCore::ComplexTextController::adjustGlyphsAndAdvances): Subtract synthetic bold offset from spaceWidth.
     12        * platform/graphics/win/UniscribeController.cpp:
     13        (WebCore::UniscribeController::shapeAndPlaceItem): Ditto.
     14
    1152011-09-30  Pavel Feldman  <pfeldman@google.com>
    216
  • trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp

    r95901 r96404  
    478478        bool lastRun = r + 1 == runCount;
    479479        bool roundsAdvances = !m_font.isPrinterFont() && fontData->platformData().roundsGlyphAdvances();
    480         CGFloat roundedSpaceWidth = roundCGFloat(fontData->spaceWidth());
     480        float spaceWidth = fontData->spaceWidth() - fontData->syntheticBoldOffset();
     481        CGFloat roundedSpaceWidth = roundCGFloat(spaceWidth);
    481482        const UChar* cp = complexTextRun.characters();
    482483        CGPoint glyphOrigin = CGPointZero;
     
    505506            bool treatAsSpace = Font::treatAsSpace(ch);
    506507            CGGlyph glyph = treatAsSpace ? fontData->spaceGlyph() : glyphs[i];
    507             CGSize advance = treatAsSpace ? CGSizeMake(fontData->spaceWidth(), advances[i].height) : advances[i];
     508            CGSize advance = treatAsSpace ? CGSizeMake(spaceWidth, advances[i].height) : advances[i];
    508509
    509510            if (ch == '\t' && m_run.allowTabs()) {
  • trunk/Source/WebCore/platform/graphics/win/UniscribeController.cpp

    r88277 r96404  
    267267
    268268    const float cLogicalScale = fontData->platformData().useGDI() ? 1.0f : 32.0f;
    269     unsigned logicalSpaceWidth = fontData->spaceWidth() * cLogicalScale;
    270     float spaceWidth = fontData->spaceWidth();
     269    float spaceWidth = fontData->spaceWidth() - fontData->syntheticBoldOffset();
     270    unsigned logicalSpaceWidth = spaceWidth * cLogicalScale;
    271271
    272272    for (int k = 0; k < len; k++) {
Note: See TracChangeset for help on using the changeset viewer.