Commit 7b4c22ba authored by simonjam@chromium.org's avatar simonjam@chromium.org
Browse files

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.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76644 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 35fc8141
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 Jer Noble <jer.noble@apple.com>
 
Unreviewed build fix: add failing test to gtk/Skipped.
......
37a781c56032c137f940246becaa431f
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x576
RenderBlock {P} at (0,0) size 784x40
RenderText {#text} at (0,0) size 99x19
text run at (0,0) width 99: "This is a test for "
RenderInline {I} at (0,0) size 756x39
RenderText {#text} at (99,0) size 756x39
text run at (99,0) width 657: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6139 ATSUI code path should implement small caps,"
text run at (0,20) width 412: "synthetic bold and oblique and correct metrics for fallback fonts"
RenderText {#text} at (412,20) size 4x19
text run at (412,20) width 4: "."
RenderBlock {HR} at (0,56) size 784x2 [border: (1px inset #000000)]
RenderBlock {P} at (0,74) size 784x20
RenderText {#text} at (0,0) size 571x19
text run at (0,0) width 571: "The two columns should be identical except for the accent over the e and the umlaut over the u."
RenderTable {TABLE} at (0,110) size 229x133 [border: none]
RenderTableSection {TBODY} at (0,0) size 228x132
RenderTableRow {TR} at (0,0) size 228x26
RenderTableCell {TD} at (0,0) size 114x26 [border: (1px solid #008000)] [r=0 c=0 rs=1 cs=1]
RenderText {#text} at (2,2) size 56x22
text run at (2,2) width 56: "Lore\x{300}m "
RenderInline {SPAN} at (0,0) size 47x22
RenderText {#text} at (58,2) size 47x22
text run at (58,2) width 47: "ipsu\x{308}m"
RenderText {#text} at (0,0) size 0x0
RenderTableCell {TD} at (114,0) size 114x26 [border: (1px solid #008000)] [r=0 c=1 rs=1 cs=1]
RenderText {#text} at (2,2) size 56x22
text run at (2,2) width 56: "Lorem "
RenderInline {SPAN} at (0,0) size 47x22
RenderText {#text} at (58,2) size 47x22
text run at (58,2) width 47: "ipsum"
RenderText {#text} at (0,0) size 0x0
RenderTableRow {TR} at (0,26) size 228x27
RenderTableCell {TD} at (0,26) size 114x27 [border: (1px solid #008000)] [r=1 c=0 rs=1 cs=1]
RenderText {#text} at (2,2) size 61x23
text run at (2,2) width 61: "Lore\x{300}m "
RenderInline {SPAN} at (0,0) size 48x23
RenderText {#text} at (63,2) size 48x23
text run at (63,2) width 48: "ipsu\x{308}m"
RenderText {#text} at (0,0) size 0x0
RenderTableCell {TD} at (114,26) size 114x27 [border: (1px solid #008000)] [r=1 c=1 rs=1 cs=1]
RenderText {#text} at (2,2) size 61x23
text run at (2,2) width 61: "Lorem "
RenderInline {SPAN} at (0,0) size 48x23
RenderText {#text} at (63,2) size 48x23
text run at (63,2) width 48: "ipsum"
RenderText {#text} at (0,0) size 0x0
RenderTableRow {TR} at (0,53) size 228x26
RenderTableCell {TD} at (0,53) size 114x26 [border: (1px solid #008000)] [r=2 c=0 rs=1 cs=1]
RenderText {#text} at (2,2) size 57x22
text run at (2,2) width 57: "Lore\x{300}m "
RenderInline {SPAN} at (0,0) size 48x22
RenderText {#text} at (59,2) size 48x22
text run at (59,2) width 48: "ipsu\x{308}m"
RenderText {#text} at (0,0) size 0x0
RenderTableCell {TD} at (114,53) size 114x26 [border: (1px solid #008000)] [r=2 c=1 rs=1 cs=1]
RenderText {#text} at (2,2) size 57x22
text run at (2,2) width 57: "Lorem "
RenderInline {SPAN} at (0,0) size 48x22
RenderText {#text} at (59,2) size 48x22
text run at (59,2) width 48: "ipsum"
RenderText {#text} at (0,0) size 0x0
RenderTableRow {TR} at (0,79) size 228x27
RenderTableCell {TD} at (0,79) size 114x27 [border: (1px solid #008000)] [r=3 c=0 rs=1 cs=1]
RenderText {#text} at (2,2) size 60x23
text run at (2,2) width 60: "Lore\x{300}m "
RenderInline {SPAN} at (0,0) size 51x23
RenderText {#text} at (62,2) size 51x23
text run at (62,2) width 51: "ipsu\x{308}m"
RenderText {#text} at (0,0) size 0x0
RenderTableCell {TD} at (114,79) size 114x27 [border: (1px solid #008000)] [r=3 c=1 rs=1 cs=1]
RenderText {#text} at (2,2) size 60x23
text run at (2,2) width 60: "Lorem "
RenderInline {SPAN} at (0,0) size 51x23
RenderText {#text} at (62,2) size 51x23
text run at (62,2) width 51: "ipsum"
RenderText {#text} at (0,0) size 0x0
RenderTableRow {TR} at (0,106) size 228x26
RenderTableCell {TD} at (0,106) size 114x26 [border: (1px solid #008000)] [r=4 c=0 rs=1 cs=1]
RenderText {#text} at (2,2) size 97x22
text run at (2,2) width 97: "Lore\x{300}m ipsu\x{308}m"
RenderTableCell {TD} at (114,106) size 114x26 [border: (1px solid #008000)] [r=4 c=1 rs=1 cs=1]
RenderText {#text} at (2,2) size 97x22
text run at (2,2) width 97: "Lorem ipsum"
RenderBlock {HR} at (0,251) size 784x2 [border: (1px inset #000000)]
RenderBlock {P} at (0,269) size 784x20
RenderText {#text} at (0,0) size 257x19
text run at (0,0) width 257: "The following two lines should be identical."
RenderBlock {P} at (0,305) size 784x21
RenderInline {SPAN} at (0,0) size 362x22 [border: (1px solid #008000)]
RenderText {#text} at (1,0) size 360x20
text run at (1,0) width 360: "\x{E01}\x{E02}\x{E03}\x{E04}\x{E05}\x{E06}\x{E07}\x{E08}\x{E01}\x{E02}\x{E03}\x{E04}\x{E05}\x{E06}\x{E07}\x{E08}\x{E01}\x{E02}\x{E03}\x{E04}\x{E05}\x{E06}\x{E07}\x{E08}\x{E01}\x{E02}\x{E03}\x{E04}\x{E05}\x{E06}\x{E07}\x{E08}"
RenderText {#text} at (0,0) size 0x0
RenderBlock {P} at (0,342) size 784x21
RenderInline {SPAN} at (0,0) size 362x22 [border: (1px solid #008000)]
RenderText {#text} at (1,0) size 360x20
text run at (1,0) width 360: "\x{E01}\x{E02}\x{E03}\x{E04}\x{E05}\x{E06}\x{E07}\x{E08}\x{E01}\x{E02}\x{E03}\x{E04}\x{E05}\x{E06}\x{E07}\x{E08}\x{E01}\x{E02}\x{E03}\x{E04}\x{E05}\x{E06}\x{E07}\x{E08}\x{E01}\x{E02}\x{E03}\x{E04}\x{E05}\x{E06}\x{E07}\x{E08}"
RenderText {#text} at (0,0) size 0x0
......@@ -551,7 +551,7 @@ BUGCR8941 WIN : http/tests/xmlhttprequest/web-apps/012.html = FAIL
// Mostly this is because of international text rendering differences.
// Incrorect results, in incorrect international font metrics.
BUGCR20521 LINUX WIN : fast/text/atsui-multiple-renderers.html = FAIL
BUGCR20521 WIN : fast/text/atsui-multiple-renderers.html = FAIL
BUGCR20521 LINUX WIN : fast/text/atsui-pointtooffset-calls-cg.html = FAIL TIMEOUT
BUGCR20521 LINUX WIN : fast/text/atsui-rtl-override-selection.html = FAIL
......@@ -1111,7 +1111,6 @@ BUGCR10342 LINUX MAC : fast/loader/file-URL-with-port-number.html = TIMEOUT
// code enabled?
BUGCR10343 LINUX : fast/text/atsui-kerning-and-ligatures.html = FAIL
BUGCR10343 LINUX RELEASE : fast/text/atsui-partial-selection.html = IMAGE
BUGCR10343 LINUX : fast/text/atsui-small-caps-punctuation-size.html = FAIL
// Started timing out with agl's complext text change. Page is verrry slow.
BUGCR10343 SKIP LINUX : fast/text/large-text-composed-char.html = TIMEOUT FAIL
......
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.
2011-01-25 Steve Falkenburg <sfalken@apple.com>
 
Rubber-stamped by Adam Roben.
......@@ -146,6 +146,9 @@ void ComplexTextController::reset(unsigned offset)
// TextRun has been reached.
bool ComplexTextController::nextScriptRun()
{
// Ensure we're not pointing at the small caps buffer.
m_item.string = m_run.characters();
if (!hb_utf16_script_run_next(&m_numCodePoints, &m_item.item, m_run.characters(), m_run.length(), &m_indexOfNextScriptRun))
return false;
......@@ -157,11 +160,15 @@ bool ComplexTextController::nextScriptRun()
// So we allow that to run first, then do a second pass over the range it
// found and take the largest subregion that stays within a single font.
m_currentFontData = m_font->glyphDataForCharacter(m_item.string[m_item.item.pos], false).fontData;
bool isFirstCharacterLowerCase = u_islower(m_item.string[m_item.item.pos]);
unsigned endOfRun;
for (endOfRun = 1; endOfRun < m_item.item.length; ++endOfRun) {
const SimpleFontData* nextFontData = m_font->glyphDataForCharacter(m_item.string[m_item.item.pos + endOfRun], false).fontData;
UChar nextCharacter = m_item.string[m_item.item.pos + endOfRun];
const SimpleFontData* nextFontData = m_font->glyphDataForCharacter(nextCharacter, false).fontData;
if (nextFontData != m_currentFontData)
break;
if (m_font->isSmallCaps() && isFirstCharacterLowerCase != u_islower(nextCharacter))
break;
}
m_item.item.length = endOfRun;
m_indexOfNextScriptRun = m_item.item.pos + endOfRun;
......@@ -184,7 +191,18 @@ float ComplexTextController::widthOfFullRun()
void ComplexTextController::setupFontForScriptRun()
{
const FontData* fontData = m_font->glyphDataForCharacter(m_item.string[m_item.item.pos], false).fontData;
FontDataVariant fontDataVariant = AutoVariant;
// Determine if this script run needs to be converted to small caps.
// nextScriptRun() will always send us a run of the same case, so we only
// need to check the first character's case.
if (m_font->isSmallCaps() && u_islower(m_item.string[m_item.item.pos])) {
m_smallCapsString = String(m_run.data(m_item.item.pos), m_item.item.length);
m_smallCapsString.makeUpper();
m_item.string = m_smallCapsString.characters();
m_item.item.pos = 0;
fontDataVariant = SmallCapsVariant;
}
const FontData* fontData = m_font->glyphDataForCharacter(m_item.string[m_item.item.pos], false, fontDataVariant).fontData;
const FontPlatformData& platformData = fontData->fontDataForCharacter(' ')->platformData();
m_item.face = platformData.harfbuzzFace();
void* opaquePlatformData = const_cast<FontPlatformData*>(&platformData);
......
......@@ -155,6 +155,7 @@ private:
// each word break we accumulate error. This is the
// number of pixels that we are behind so far.
int m_letterSpacing; // pixels to be added after each glyph.
String m_smallCapsString; // substring of m_run converted to small caps.
};
} // namespace WebCore
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment