Changeset 70569 in webkit
- Timestamp:
- Oct 26, 2010 1:47:13 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r70563 r70569 1 2010-10-26 takano takumi <takano1@asia.apple.com> 2 3 Reviewed by Dave Hyatt. 4 5 Advances are wrong and glyphs are rotated improperly in vertical writing 6 https://bugs.webkit.org/show_bug.cgi?id=48315 7 8 Changed tests to check more glyphs and updated results. 9 10 * fast/text/international/vertical-text-glyph-test.html: 11 * fast/text/international/vertical-text-metrics-test.html: 12 * platform/mac/fast/text/international/vertical-text-glyph-test-expected.checksum: 13 * platform/mac/fast/text/international/vertical-text-glyph-test-expected.png: 14 * platform/mac/fast/text/international/vertical-text-glyph-test-expected.txt: 15 * platform/mac/fast/text/international/vertical-text-metrics-test-expected.txt: 16 1 17 2010-10-26 Dimitri Glazkov <dglazkov@chromium.org> 2 18 -
trunk/LayoutTests/fast/text/international/vertical-text-glyph-test.html
r70260 r70569 7 7 body { 8 8 font-family: "HiraMinPro-W3"; 9 font-size: large;9 font-size: 16pt; 10 10 } 11 11 #horizontal_TB { … … 41 41 <body> 42 42 <p>Simple text path</p> 43 <span id="vertical_RL">abあ「」。</span><br> 44 <br> 43 <span id="vertical_RL">string「あ、変っ!」。</span> 45 44 <hr> 46 45 <p>Complex text path</p> 47 <span id="vertical_RL_complex">abあ「」。1⃝</span><br> 48 <br> 49 <hr> 46 <span id="vertical_RL_complex">string「あ、変っ!」。</span> 50 47 </body> 51 48 </html> -
trunk/LayoutTests/fast/text/international/vertical-text-metrics-test.html
r70250 r70569 27 27 body { 28 28 font-family: "HiraMinPro-W3"; 29 font-size: large;29 font-size: 16pt; 30 30 } 31 31 #horizontal_TB { … … 61 61 <body onload="test()"> 62 62 <p>Simple text path</p> 63 <span id="horizontal_TB"> abあ「」。</span><br>64 <span id="horizontal_BT"> abあ「」。</span><br>65 <span id="vertical_RL"> abあ「」。</span><br>66 <span id="vertical_LR"> abあ「」。</span><br>63 <span id="horizontal_TB">string「あ、変っ!」。</span><br> 64 <span id="horizontal_BT">string「あ、変っ!」。</span><br> 65 <span id="vertical_RL">string「あ、変っ!」。</span><br> 66 <span id="vertical_LR">string「あ、変っ!」。</span><br> 67 67 <br> 68 68 <hr> 69 69 <p>Complex text path</p> 70 <span id="horizontal_TB_complex"> abあ「」。1⃝</span><br>71 <span id="horizontal_BT_complex"> abあ「」。1⃝</span><br>72 <span id="vertical_RL_complex"> abあ「」。1⃝</span><br>73 <span id="vertical_LR_complex"> abあ「」。1⃝</span><br>70 <span id="horizontal_TB_complex">string「あ、変っ!」。</span><br> 71 <span id="horizontal_BT_complex">string「あ、変っ!」。</span><br> 72 <span id="vertical_RL_complex">string「あ、変っ!」。</span><br> 73 <span id="vertical_LR_complex">string「あ、変っ!」。</span><br> 74 74 <br> 75 75 <hr> -
trunk/LayoutTests/platform/mac/fast/blockflow/english-lr-text-expected.checksum
r70268 r70569 1 9a4b832e0b5772ba0e59914f3c59214f 1 f877c89d5f5032abe0650a578dc81375 -
trunk/LayoutTests/platform/mac/fast/blockflow/english-lr-text-expected.txt
r70268 r70569 4 4 RenderBlock {HTML} at (0,0) size 800x600 5 5 RenderBody {BODY} at (8,8) size 784x584 6 RenderBlock {DIV} at (0,0) size 242x500 7 RenderInline {SPAN} at (0,0) size 456x22 8 RenderText {#text} at (0,0) size 456x22 9 text run at (0,0) width 456: "This text should be rotated 90 degrees and" 10 text run at (22,0) width 122: "underlined." 11 RenderText {#text} at (22,122) size 5x22 12 text run at (22,122) width 5: " " 13 RenderBR {BR} at (27,127) size 0x0 14 RenderInline {SPAN} at (0,0) size 456x22 15 RenderText {#text} at (44,0) size 456x22 16 text run at (44,0) width 456: "This text should be rotated 90 degrees and" 17 text run at (66,0) width 108: "overlined." 18 RenderText {#text} at (66,108) size 5x22 19 text run at (66,108) width 5: " " 20 RenderBR {BR} at (71,113) size 0x0 21 RenderInline {SPAN} at (0,0) size 456x22 22 RenderText {#text} at (88,0) size 456x22 23 text run at (88,0) width 456: "This text should be rotated 90 degrees and" 24 text run at (110,0) width 162: "struck through." 25 RenderText {#text} at (110,162) size 5x22 26 text run at (110,162) width 5: " " 27 RenderBR {BR} at (115,167) size 0x0 28 RenderInline {SPAN} at (0,0) size 448x22 29 RenderText {#text} at (132,0) size 448x22 30 text run at (132,0) width 448: "This text should have a red shadow that is" 31 text run at (154,0) width 225: "offset horizontally." 32 RenderText {#text} at (154,225) size 5x22 33 text run at (154,225) width 5: " " 34 RenderBR {BR} at (159,230) size 0x0 35 RenderBR {BR} at (176,0) size 0x22 36 RenderInline {SPAN} at (0,0) size 407x22 37 RenderText {#text} at (198,0) size 407x22 38 text run at (198,0) width 407: "This text should have an overline plus" 39 text run at (220,0) width 251: "horizontal green shadow" 6 RenderBlock {DIV} at (0,0) size 132x500 7 RenderInline {SPAN} at (0,0) size 395x22 8 RenderText {#text} at (0,0) size 395x22 9 text run at (0,0) width 395: "This text should be rotated 90 degrees and underlined." 10 RenderText {#text} at (0,395) size 5x22 11 text run at (0,395) width 5: " " 12 RenderBR {BR} at (5,400) size 0x0 13 RenderInline {SPAN} at (0,0) size 386x22 14 RenderText {#text} at (22,0) size 386x22 15 text run at (22,0) width 386: "This text should be rotated 90 degrees and overlined." 16 RenderText {#text} at (22,386) size 5x22 17 text run at (22,386) width 5: " " 18 RenderBR {BR} at (27,391) size 0x0 19 RenderInline {SPAN} at (0,0) size 423x22 20 RenderText {#text} at (44,0) size 423x22 21 text run at (44,0) width 423: "This text should be rotated 90 degrees and struck through." 22 RenderText {#text} at (44,423) size 5x22 23 text run at (44,423) width 5: " " 24 RenderBR {BR} at (49,428) size 0x0 25 RenderInline {SPAN} at (0,0) size 449x22 26 RenderText {#text} at (66,0) size 449x22 27 text run at (66,0) width 449: "This text should have a red shadow that is offset horizontally." 28 RenderText {#text} at (66,449) size 5x22 29 text run at (66,449) width 5: " " 30 RenderBR {BR} at (71,454) size 0x0 31 RenderBR {BR} at (88,0) size 0x22 32 RenderInline {SPAN} at (0,0) size 460x22 33 RenderText {#text} at (110,0) size 460x22 34 text run at (110,0) width 460: "This text should have an overline plus horizontal green shadow" -
trunk/LayoutTests/platform/mac/fast/blockflow/english-rl-text-expected.checksum
r70546 r70569 1 e8dc37381cc28ada4722d8e2aaf824c7 1 86bce170b6e5c4eac8bb00675512383d -
trunk/LayoutTests/platform/mac/fast/blockflow/english-rl-text-expected.txt
r70546 r70569 6 6 RenderBlock {DIV} at (18,2) size 204x580 [border: (2px solid #800000)] 7 7 RenderBlock (floating) {DIV} at (2,478) size 100x100 [bgcolor=#00FF00] 8 RenderText {#text} at (2,2) size 417x189 text run at (2,2) width 417: "Here is some text in a vertical-rl block flow. "10 text run at (2, 419) width 34: "The"11 text run at (20,2) width 318: "block direction is right-to-left."12 RenderBR {BR} at (34, 320) size 0x013 RenderText {#text} at (38,2) size 324x1814 text run at (38,2) width 324: "This line should also be vertical."8 RenderText {#text} at (2,2) size 280x18 9 text run at (2,2) width 280: "Here is some text in a vertical-rl block flow. " 10 text run at (2,282) width 192: "The block direction is right-to-" 11 text run at (20,2) width 24: "left." 12 RenderBR {BR} at (34,26) size 0x0 13 RenderText {#text} at (38,2) size 203x18 14 text run at (38,2) width 203: "This line should also be vertical." -
trunk/LayoutTests/platform/mac/fast/text/international/vertical-text-glyph-test-expected.checksum
r70263 r70569 1 386f323eb617f371186afe888df1ce4e 1 97299ec70f0a6a19601d0cfd36516b65 -
trunk/LayoutTests/platform/mac/fast/text/international/vertical-text-glyph-test-expected.txt
r70260 r70569 1 layer at (0,0) size 800x600 2 RenderView at (0,0) size 800x600 3 layer at (0,0) size 800x442 4 RenderBlock {HTML} at (0,0) size 800x442 5 RenderBody {BODY} at (8,18) size 784x415 6 RenderBlock {P} at (0,0) size 784x27 7 RenderText {#text} at (0,4) size 139x19 8 text run at (0,4) width 139: "Simple text path" 9 RenderBlock (anonymous) at (0,45) size 784x129 10 RenderBlock {SPAN} at (0,0) size 27x95 11 RenderText {#text} at (4,0) size 95x19 12 text run at (4,0) width 95: "ab\x{3042}\x{300C}\x{300D}\x{3002}" 13 RenderBR {BR} at (27,79) size 0x19 14 RenderBR {BR} at (0,106) size 0x19 15 RenderBlock {HR} at (0,183) size 784x2 [border: (1px inset #000000)] 16 RenderBlock {P} at (0,203) size 784x27 17 RenderText {#text} at (0,4) size 157x19 18 text run at (0,4) width 157: "Complex text path" 19 RenderBlock (anonymous) at (0,248) size 784x156 20 RenderBlock {SPAN} at (0,0) size 27x122 21 RenderText {#text} at (4,0) size 122x19 22 text run at (4,0) width 122: "ab\x{3042}\x{300C}\x{300D}\x{3002}1\x{20DD}" 23 RenderBR {BR} at (27,106) size 0x19 24 RenderBR {BR} at (0,133) size 0x19 25 RenderBlock {HR} at (0,413) size 784x2 [border: (1px inset #000000)] 1 layer at (0,0) size 785x635 2 RenderView at (0,0) size 785x600 3 layer at (0,0) size 785x635 4 RenderBlock {HTML} at (0,0) size 785x635 5 RenderBody {BODY} at (8,21) size 769x606 6 RenderBlock {P} at (0,0) size 769x32 7 RenderText {#text} at (0,5) size 161x21 8 text run at (0,5) width 161: "Simple text path" 9 RenderBlock (anonymous) at (0,53) size 769x235 10 RenderBlock {SPAN} at (0,0) size 32x226 11 RenderText {#text} at (5,0) size 226x21 12 text run at (5,0) width 226: "string\x{300C}\x{3042}\x{3001}\x{5909}\x{3063}\x{FF01}\x{300D}\x{3002}" 13 RenderText {#text} at (0,0) size 0x0 14 RenderBlock {HR} at (0,298) size 769x2 [border: (1px inset #000000)] 15 RenderBlock {P} at (0,321) size 769x32 16 RenderText {#text} at (0,5) size 181x21 17 text run at (0,5) width 181: "Complex text path" 18 RenderBlock (anonymous) at (0,374) size 769x232 19 RenderBlock {SPAN} at (0,0) size 32x223 20 RenderText {#text} at (5,0) size 223x21 21 text run at (5,0) width 223: "string\x{300C}\x{3042}\x{3001}\x{5909}\x{3063}\x{FF01}\x{300D}\x{3002}" 22 RenderText {#text} at (0,0) size 0x0 -
trunk/LayoutTests/platform/mac/fast/text/international/vertical-text-metrics-test-expected.txt
r70250 r70569 1 1 Simple text path 2 2 3 abあ「」。4 abあ「」。5 abあ「」。6 abあ「」。3 string「あ、変っ!」。 4 string「あ、変っ!」。 5 string「あ、変っ!」。 6 string「あ、変っ!」。 7 7 8 8 Complex text path 9 9 10 abあ「」。1⃝ 11 abあ「」。1⃝ 12 abあ「」。1⃝ 13 abあ「」。1⃝ 10 string「あ、変っ!」。 11 string「あ、変っ!」。 12 string「あ、変っ!」。 13 string「あ、変っ!」。 14 14 15 width= 9316 width= 9317 width= 2718 width= 2719 width= 10320 width= 10321 width= 2722 width= 2715 width=223 16 width=223 17 width=32 18 width=32 19 width=223 20 width=223 21 width=32 22 width=32 23 23 -
trunk/WebCore/ChangeLog
r70567 r70569 1 2010-10-26 takano takumi <takano1@asia.apple.com> 2 3 Reviewed by Dave Hyatt. 4 5 Advances are wrong and glyphs are rotated improperly in vertical writing 6 https://bugs.webkit.org/show_bug.cgi?id=48315 7 8 We shouldn't use vertical metrics for Roman fonts. Also, we should rotate vertical variant 9 glyphs back on drawing as the whole run has already been rotated beforehand. 10 11 * platform/graphics/cocoa/FontPlatformDataCocoa.mm: 12 (WebCore::FontPlatformData::FontPlatformData): Changed to ignore vertical orientation when the font doesn't support vertical metrics. 13 * platform/graphics/mac/FontMac.mm: 14 (WebCore::showGlyphsWithAdvances): Changed to rotate glyphs -90 degree for vertical variants. 15 (WebCore::Font::drawGlyphs): 16 1 17 2010-10-26 Satish Sampath <satish@chromium.org> 2 18 -
trunk/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm
r70250 r70569 48 48 : m_syntheticBold(syntheticBold) 49 49 , m_syntheticOblique(syntheticOblique) 50 , m_orientation(orientation)51 50 , m_font(nsFont) 52 51 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) … … 65 64 loadFont(nsFont, m_size, m_font, cgFont, m_atsuFontID); 66 65 66 if (orientation == Vertical) { 67 // Ignore vertical orientation when the font doesn't support vertical metrics. 68 // The check doesn't look neat but this is what AppKit does for vertical writing... 69 RetainPtr<CFArrayRef> tableTags(AdoptCF, CTFontCopyAvailableTables(ctFont(), kCTFontTableOptionExcludeSynthetic)); 70 CFIndex numTables = CFArrayGetCount(tableTags.get()); 71 bool found = false; 72 for (CFIndex index = 0; index < numTables; ++index) { 73 CTFontTableTag tag = (CTFontTableTag)(uintptr_t)CFArrayGetValueAtIndex(tableTags.get(), index); 74 if (tag == kCTFontTableVhea || tag == kCTFontTableVORG) { 75 found = true; 76 break; 77 } 78 } 79 80 if (found == false) 81 orientation = Horizontal; 82 } 83 84 m_orientation = orientation; 85 67 86 if (m_font) 68 87 CFRetain(m_font); -
trunk/WebCore/platform/graphics/mac/FontMac.mm
r66082 r70569 48 48 } 49 49 50 static void showGlyphsWithAdvances(const FontPlatformData&font, CGContextRef context, const CGGlyph* glyphs, const CGSize* advances, size_t count)50 static void showGlyphsWithAdvances(const SimpleFontData* font, CGContextRef context, const CGGlyph* glyphs, const CGSize* advances, size_t count) 51 51 { 52 if (!font.isColorBitmapFont()) 52 const FontPlatformData& platformData = font->platformData(); 53 if (!platformData.isColorBitmapFont()) { 54 CGAffineTransform savedMatrix; 55 bool isVertical = platformData.orientation() == Vertical; 56 57 if (isVertical) { 58 static const CGAffineTransform rotateLeftTransform = {0.0, -1.0, 1.0, 0.0, 0.0, 0.0}; 59 60 savedMatrix = CGContextGetTextMatrix(context); 61 CGAffineTransform runMatrix = CGAffineTransformConcat(savedMatrix, rotateLeftTransform); 62 // Move start point to put glyphs into original region. 63 runMatrix.tx = savedMatrix.tx + font->ascent(); 64 runMatrix.ty = savedMatrix.ty + font->descent(); 65 CGContextSetTextMatrix(context, runMatrix); 66 } 67 53 68 CGContextShowGlyphsWithAdvances(context, glyphs, advances, count); 69 70 if (isVertical) 71 CGContextSetTextMatrix(context, savedMatrix); 72 } 54 73 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) 55 74 else { … … 65 84 positions[i].y = positions[i - 1].y + advance.height; 66 85 } 67 CTFontDrawGlyphs( font.ctFont(), glyphs, positions.data(), count, context);86 CTFontDrawGlyphs(platformData.ctFont(), glyphs, positions.data(), count, context); 68 87 } 69 88 #endif … … 150 169 context->setFillColor(shadowFillColor, fillColorSpace); 151 170 CGContextSetTextPosition(cgContext, point.x() + shadowOffset.width(), point.y() + shadowOffset.height()); 152 showGlyphsWithAdvances( platformData, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);171 showGlyphsWithAdvances(font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs); 153 172 if (font->syntheticBoldOffset()) { 154 173 CGContextSetTextPosition(cgContext, point.x() + shadowOffset.width() + font->syntheticBoldOffset(), point.y() + shadowOffset.height()); 155 showGlyphsWithAdvances( platformData, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);174 showGlyphsWithAdvances(font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs); 156 175 } 157 176 context->setFillColor(fillColor, fillColorSpace); … … 159 178 160 179 CGContextSetTextPosition(cgContext, point.x(), point.y()); 161 showGlyphsWithAdvances( platformData, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);180 showGlyphsWithAdvances(font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs); 162 181 if (font->syntheticBoldOffset()) { 163 182 CGContextSetTextPosition(cgContext, point.x() + font->syntheticBoldOffset(), point.y()); 164 showGlyphsWithAdvances( platformData, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);183 showGlyphsWithAdvances(font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs); 165 184 } 166 185
Note: See TracChangeset
for help on using the changeset viewer.