Changeset 76644 in webkit


Ignore:
Timestamp:
Jan 25, 2011 3:07:06 PM (13 years ago)
Author:
simonjam@chromium.org
Message:

2011-01-25 James Simonsen <simonjam@chromium.org>

Reviewed by Tony Chang.

[Chromium] Support small caps in complex text on linux
https://bugs.webkit.org/show_bug.cgi?id=53051

  • platform/chromium-linux/fast/text/atsui-multiple-renderers-expected.checksum: Added.
  • platform/chromium-linux/fast/text/atsui-multiple-renderers-expected.png: Added.
  • platform/chromium-linux/fast/text/atsui-multiple-renderers-expected.txt: Added.
  • platform/chromium-linux/fast/text/atsui-small-caps-punctuation-size-expected.checksum: Added.
  • platform/chromium-linux/fast/text/atsui-small-caps-punctuation-size-expected.png: Added.
  • platform/chromium/test_expectations.txt: Re-enable 2 tests on linux.

2011-01-25 James Simonsen <simonjam@chromium.org>

Reviewed by Tony Chang.

[Chromium] Support small caps in complex text on linux
https://bugs.webkit.org/show_bug.cgi?id=53051

  • platform/graphics/chromium/ComplexTextControllerLinux.cpp: (WebCore::ComplexTextController::nextScriptRun): Break runs at small caps boundaries. (WebCore::ComplexTextController::setupFontForScriptRun): Setup small caps font data if needed.
  • platform/graphics/chromium/ComplexTextControllerLinux.h: Store small caps text in separate string.
Location:
trunk
Files:
5 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r76640 r76644  
     12011-01-25  James Simonsen  <simonjam@chromium.org>
     2
     3        Reviewed by Tony Chang.
     4
     5        [Chromium] Support small caps in complex text on linux
     6        https://bugs.webkit.org/show_bug.cgi?id=53051
     7
     8        * platform/chromium-linux/fast/text/atsui-multiple-renderers-expected.checksum: Added.
     9        * platform/chromium-linux/fast/text/atsui-multiple-renderers-expected.png: Added.
     10        * platform/chromium-linux/fast/text/atsui-multiple-renderers-expected.txt: Added.
     11        * platform/chromium-linux/fast/text/atsui-small-caps-punctuation-size-expected.checksum: Added.
     12        * platform/chromium-linux/fast/text/atsui-small-caps-punctuation-size-expected.png: Added.
     13        * platform/chromium/test_expectations.txt: Re-enable 2 tests on linux.
     14
    1152011-01-25  Jer Noble  <jer.noble@apple.com>
    216
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r76632 r76644  
    552552
    553553// Incrorect results, in incorrect international font metrics.
    554 BUGCR20521 LINUX WIN : fast/text/atsui-multiple-renderers.html = FAIL
     554BUGCR20521 WIN : fast/text/atsui-multiple-renderers.html = FAIL
    555555BUGCR20521 LINUX WIN : fast/text/atsui-pointtooffset-calls-cg.html = FAIL TIMEOUT
    556556BUGCR20521 LINUX WIN : fast/text/atsui-rtl-override-selection.html = FAIL
     
    11121112BUGCR10343 LINUX : fast/text/atsui-kerning-and-ligatures.html = FAIL
    11131113BUGCR10343 LINUX RELEASE : fast/text/atsui-partial-selection.html = IMAGE
    1114 BUGCR10343 LINUX : fast/text/atsui-small-caps-punctuation-size.html = FAIL
    11151114
    11161115// Started timing out with agl's complext text change.  Page is verrry slow.
  • trunk/Source/WebCore/ChangeLog

    r76638 r76644  
     12011-01-25  James Simonsen  <simonjam@chromium.org>
     2
     3        Reviewed by Tony Chang.
     4
     5        [Chromium] Support small caps in complex text on linux
     6        https://bugs.webkit.org/show_bug.cgi?id=53051
     7
     8        * platform/graphics/chromium/ComplexTextControllerLinux.cpp:
     9        (WebCore::ComplexTextController::nextScriptRun): Break runs at small caps boundaries.
     10        (WebCore::ComplexTextController::setupFontForScriptRun): Setup small caps font data if needed.
     11        * platform/graphics/chromium/ComplexTextControllerLinux.h: Store small caps text in separate string.
     12
    1132011-01-25  Steve Falkenburg  <sfalken@apple.com>
    214
  • trunk/Source/WebCore/platform/graphics/chromium/ComplexTextControllerLinux.cpp

    r76170 r76644  
    147147bool ComplexTextController::nextScriptRun()
    148148{
     149    // Ensure we're not pointing at the small caps buffer.
     150    m_item.string = m_run.characters();
     151
    149152    if (!hb_utf16_script_run_next(&m_numCodePoints, &m_item.item, m_run.characters(), m_run.length(), &m_indexOfNextScriptRun))
    150153        return false;
     
    158161    // found and take the largest subregion that stays within a single font.
    159162    m_currentFontData = m_font->glyphDataForCharacter(m_item.string[m_item.item.pos], false).fontData;
     163    bool isFirstCharacterLowerCase = u_islower(m_item.string[m_item.item.pos]);
    160164    unsigned endOfRun;
    161165    for (endOfRun = 1; endOfRun < m_item.item.length; ++endOfRun) {
    162         const SimpleFontData* nextFontData = m_font->glyphDataForCharacter(m_item.string[m_item.item.pos + endOfRun], false).fontData;
     166        UChar nextCharacter = m_item.string[m_item.item.pos + endOfRun];
     167        const SimpleFontData* nextFontData = m_font->glyphDataForCharacter(nextCharacter, false).fontData;
    163168        if (nextFontData != m_currentFontData)
     169            break;
     170        if (m_font->isSmallCaps() && isFirstCharacterLowerCase != u_islower(nextCharacter))
    164171            break;
    165172    }
     
    185192void ComplexTextController::setupFontForScriptRun()
    186193{
    187     const FontData* fontData = m_font->glyphDataForCharacter(m_item.string[m_item.item.pos], false).fontData;
     194    FontDataVariant fontDataVariant = AutoVariant;
     195    // Determine if this script run needs to be converted to small caps.
     196    // nextScriptRun() will always send us a run of the same case, so we only
     197    // need to check the first character's case.
     198    if (m_font->isSmallCaps() && u_islower(m_item.string[m_item.item.pos])) {
     199        m_smallCapsString = String(m_run.data(m_item.item.pos), m_item.item.length);
     200        m_smallCapsString.makeUpper();
     201        m_item.string = m_smallCapsString.characters();
     202        m_item.item.pos = 0;
     203        fontDataVariant = SmallCapsVariant;
     204    }
     205    const FontData* fontData = m_font->glyphDataForCharacter(m_item.string[m_item.item.pos], false, fontDataVariant).fontData;
    188206    const FontPlatformData& platformData = fontData->fontDataForCharacter(' ')->platformData();
    189207    m_item.face = platformData.harfbuzzFace();
  • trunk/Source/WebCore/platform/graphics/chromium/ComplexTextControllerLinux.h

    r76137 r76644  
    156156                      // number of pixels that we are behind so far.
    157157    int m_letterSpacing; // pixels to be added after each glyph.
     158    String m_smallCapsString; // substring of m_run converted to small caps.
    158159};
    159160
Note: See TracChangeset for help on using the changeset viewer.