[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

hyatt at apple.com hyatt at apple.com
Wed Dec 22 14:58:53 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 00a8755477ce82f57682d15169dc87f7330e04ea
Author: hyatt at apple.com <hyatt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Oct 26 20:47:13 2010 +0000

    Advances are wrong and glyphs are rotated improperly in vertical writing
    https://bugs.webkit.org/show_bug.cgi?id=48315
    
    Patch by takano takumi <takano1 at asia.apple.com> on 2010-10-26
    Reviewed by Dave Hyatt.
    
    WebCore:
    
    We shouldn't use vertical metrics for Roman fonts. Also, we should rotate vertical variant
    glyphs back on drawing as the whole run has already been rotated beforehand.
    
    * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
    (WebCore::FontPlatformData::FontPlatformData): Changed to ignore vertical orientation when the font doesn't support vertical metrics.
    * platform/graphics/mac/FontMac.mm:
    (WebCore::showGlyphsWithAdvances): Changed to rotate glyphs -90 degree for vertical variants.
    (WebCore::Font::drawGlyphs):
    
    LayoutTests:
    
    Changed tests to check more glyphs and updated results.
    
    * fast/text/international/vertical-text-glyph-test.html:
    * fast/text/international/vertical-text-metrics-test.html:
    * platform/mac/fast/text/international/vertical-text-glyph-test-expected.checksum:
    * platform/mac/fast/text/international/vertical-text-glyph-test-expected.png:
    * platform/mac/fast/text/international/vertical-text-glyph-test-expected.txt:
    * platform/mac/fast/text/international/vertical-text-metrics-test-expected.txt:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70569 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 18c9287..acfaa0a 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,19 @@
+2010-10-26  takano takumi  <takano1 at asia.apple.com>
+
+        Reviewed by Dave Hyatt.
+
+        Advances are wrong and glyphs are rotated improperly in vertical writing
+        https://bugs.webkit.org/show_bug.cgi?id=48315
+
+        Changed tests to check more glyphs and updated results.
+
+        * fast/text/international/vertical-text-glyph-test.html:
+        * fast/text/international/vertical-text-metrics-test.html:
+        * platform/mac/fast/text/international/vertical-text-glyph-test-expected.checksum:
+        * platform/mac/fast/text/international/vertical-text-glyph-test-expected.png:
+        * platform/mac/fast/text/international/vertical-text-glyph-test-expected.txt:
+        * platform/mac/fast/text/international/vertical-text-metrics-test-expected.txt:
+
 2010-10-26  Dimitri Glazkov  <dglazkov at chromium.org>
 
         [Chromium] Add/change baselines after r70546 and added Chromium-mac
diff --git a/LayoutTests/fast/text/international/vertical-text-glyph-test.html b/LayoutTests/fast/text/international/vertical-text-glyph-test.html
index 5aa1ede..adaef65 100644
--- a/LayoutTests/fast/text/international/vertical-text-glyph-test.html
+++ b/LayoutTests/fast/text/international/vertical-text-glyph-test.html
@@ -6,7 +6,7 @@
 <style>
 body {
     font-family: "HiraMinPro-W3";
-    font-size: large;
+    font-size: 16pt;
 }
 #horizontal_TB {
     -webkit-writing-mode: horizontal-tb;
@@ -40,12 +40,9 @@ body {
 </head>
 <body>
 <p>Simple text path</p>
-<span id="vertical_RL">abあ「」。</span><br>
-<br>
+<span id="vertical_RL">string「あ、変っ!」。</span>
 <hr>
 <p>Complex text path</p>
-<span id="vertical_RL_complex">abあ「」。1⃝</span><br>
-<br>
-<hr>
+<span id="vertical_RL_complex">string「あ、変っ!」。</span>
 </body>
 </html>
diff --git a/LayoutTests/fast/text/international/vertical-text-metrics-test.html b/LayoutTests/fast/text/international/vertical-text-metrics-test.html
index b29ecae..1df0f6e 100644
--- a/LayoutTests/fast/text/international/vertical-text-metrics-test.html
+++ b/LayoutTests/fast/text/international/vertical-text-metrics-test.html
@@ -26,7 +26,7 @@ function test()
 <style>
 body {
     font-family: "HiraMinPro-W3";
-    font-size: large;
+    font-size: 16pt;
 }
 #horizontal_TB {
     -webkit-writing-mode: horizontal-tb;
@@ -60,17 +60,17 @@ body {
 </head>
 <body onload="test()">
 <p>Simple text path</p>
-<span id="horizontal_TB">abあ「」。</span><br>
-<span id="horizontal_BT">abあ「」。</span><br>
-<span id="vertical_RL">abあ「」。</span><br>
-<span id="vertical_LR">abあ「」。</span><br>
+<span id="horizontal_TB">string「あ、変っ!」。</span><br>
+<span id="horizontal_BT">string「あ、変っ!」。</span><br>
+<span id="vertical_RL">string「あ、変っ!」。</span><br>
+<span id="vertical_LR">string「あ、変っ!」。</span><br>
 <br>
 <hr>
 <p>Complex text path</p>
-<span id="horizontal_TB_complex">abあ「」。1⃝</span><br>
-<span id="horizontal_BT_complex">abあ「」。1⃝</span><br>
-<span id="vertical_RL_complex">abあ「」。1⃝</span><br>
-<span id="vertical_LR_complex">abあ「」。1⃝</span><br>
+<span id="horizontal_TB_complex">string「あ、変っ!」。</span><br>
+<span id="horizontal_BT_complex">string「あ、変っ!」。</span><br>
+<span id="vertical_RL_complex">string「あ、変っ!」。</span><br>
+<span id="vertical_LR_complex">string「あ、変っ!」。</span><br>
 <br>
 <hr>
 <p><ol id=console></ol></p>
diff --git a/LayoutTests/platform/mac/fast/blockflow/english-lr-text-expected.checksum b/LayoutTests/platform/mac/fast/blockflow/english-lr-text-expected.checksum
index d1d04e8..bd9a5d5 100644
--- a/LayoutTests/platform/mac/fast/blockflow/english-lr-text-expected.checksum
+++ b/LayoutTests/platform/mac/fast/blockflow/english-lr-text-expected.checksum
@@ -1 +1 @@
-9a4b832e0b5772ba0e59914f3c59214f
\ No newline at end of file
+f877c89d5f5032abe0650a578dc81375
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/blockflow/english-lr-text-expected.png b/LayoutTests/platform/mac/fast/blockflow/english-lr-text-expected.png
index 988122f..d4a31c2 100644
Binary files a/LayoutTests/platform/mac/fast/blockflow/english-lr-text-expected.png and b/LayoutTests/platform/mac/fast/blockflow/english-lr-text-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/blockflow/english-lr-text-expected.txt b/LayoutTests/platform/mac/fast/blockflow/english-lr-text-expected.txt
index 19172d9..5b12a55 100644
--- a/LayoutTests/platform/mac/fast/blockflow/english-lr-text-expected.txt
+++ b/LayoutTests/platform/mac/fast/blockflow/english-lr-text-expected.txt
@@ -3,37 +3,32 @@ layer at (0,0) size 800x600
 layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
-      RenderBlock {DIV} at (0,0) size 242x500
-        RenderInline {SPAN} at (0,0) size 456x22
-          RenderText {#text} at (0,0) size 456x22
-            text run at (0,0) width 456: "This text should be rotated 90 degrees and"
-            text run at (22,0) width 122: "underlined."
-        RenderText {#text} at (22,122) size 5x22
-          text run at (22,122) width 5: " "
-        RenderBR {BR} at (27,127) size 0x0
-        RenderInline {SPAN} at (0,0) size 456x22
-          RenderText {#text} at (44,0) size 456x22
-            text run at (44,0) width 456: "This text should be rotated 90 degrees and"
-            text run at (66,0) width 108: "overlined."
-        RenderText {#text} at (66,108) size 5x22
-          text run at (66,108) width 5: " "
-        RenderBR {BR} at (71,113) size 0x0
-        RenderInline {SPAN} at (0,0) size 456x22
-          RenderText {#text} at (88,0) size 456x22
-            text run at (88,0) width 456: "This text should be rotated 90 degrees and"
-            text run at (110,0) width 162: "struck through."
-        RenderText {#text} at (110,162) size 5x22
-          text run at (110,162) width 5: " "
-        RenderBR {BR} at (115,167) size 0x0
-        RenderInline {SPAN} at (0,0) size 448x22
-          RenderText {#text} at (132,0) size 448x22
-            text run at (132,0) width 448: "This text should have a red shadow that is"
-            text run at (154,0) width 225: "offset horizontally."
-        RenderText {#text} at (154,225) size 5x22
-          text run at (154,225) width 5: " "
-        RenderBR {BR} at (159,230) size 0x0
-        RenderBR {BR} at (176,0) size 0x22
-        RenderInline {SPAN} at (0,0) size 407x22
-          RenderText {#text} at (198,0) size 407x22
-            text run at (198,0) width 407: "This text should have an overline plus"
-            text run at (220,0) width 251: "horizontal green shadow"
+      RenderBlock {DIV} at (0,0) size 132x500
+        RenderInline {SPAN} at (0,0) size 395x22
+          RenderText {#text} at (0,0) size 395x22
+            text run at (0,0) width 395: "This text should be rotated 90 degrees and underlined."
+        RenderText {#text} at (0,395) size 5x22
+          text run at (0,395) width 5: " "
+        RenderBR {BR} at (5,400) size 0x0
+        RenderInline {SPAN} at (0,0) size 386x22
+          RenderText {#text} at (22,0) size 386x22
+            text run at (22,0) width 386: "This text should be rotated 90 degrees and overlined."
+        RenderText {#text} at (22,386) size 5x22
+          text run at (22,386) width 5: " "
+        RenderBR {BR} at (27,391) size 0x0
+        RenderInline {SPAN} at (0,0) size 423x22
+          RenderText {#text} at (44,0) size 423x22
+            text run at (44,0) width 423: "This text should be rotated 90 degrees and struck through."
+        RenderText {#text} at (44,423) size 5x22
+          text run at (44,423) width 5: " "
+        RenderBR {BR} at (49,428) size 0x0
+        RenderInline {SPAN} at (0,0) size 449x22
+          RenderText {#text} at (66,0) size 449x22
+            text run at (66,0) width 449: "This text should have a red shadow that is offset horizontally."
+        RenderText {#text} at (66,449) size 5x22
+          text run at (66,449) width 5: " "
+        RenderBR {BR} at (71,454) size 0x0
+        RenderBR {BR} at (88,0) size 0x22
+        RenderInline {SPAN} at (0,0) size 460x22
+          RenderText {#text} at (110,0) size 460x22
+            text run at (110,0) width 460: "This text should have an overline plus horizontal green shadow"
diff --git a/LayoutTests/platform/mac/fast/blockflow/english-rl-text-expected.checksum b/LayoutTests/platform/mac/fast/blockflow/english-rl-text-expected.checksum
index f4d0bec..5c1c195 100644
--- a/LayoutTests/platform/mac/fast/blockflow/english-rl-text-expected.checksum
+++ b/LayoutTests/platform/mac/fast/blockflow/english-rl-text-expected.checksum
@@ -1 +1 @@
-e8dc37381cc28ada4722d8e2aaf824c7
\ No newline at end of file
+86bce170b6e5c4eac8bb00675512383d
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/blockflow/english-rl-text-expected.png b/LayoutTests/platform/mac/fast/blockflow/english-rl-text-expected.png
index fa00c11..a118716 100644
Binary files a/LayoutTests/platform/mac/fast/blockflow/english-rl-text-expected.png and b/LayoutTests/platform/mac/fast/blockflow/english-rl-text-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/blockflow/english-rl-text-expected.txt b/LayoutTests/platform/mac/fast/blockflow/english-rl-text-expected.txt
index c8341a9..66c514c 100644
--- a/LayoutTests/platform/mac/fast/blockflow/english-rl-text-expected.txt
+++ b/LayoutTests/platform/mac/fast/blockflow/english-rl-text-expected.txt
@@ -5,10 +5,10 @@ layer at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 504x584 [border: (2px solid #000000)]
       RenderBlock {DIV} at (18,2) size 204x580 [border: (2px solid #800000)]
         RenderBlock (floating) {DIV} at (2,478) size 100x100 [bgcolor=#00FF00]
-        RenderText {#text} at (2,2) size 417x18
-          text run at (2,2) width 417: "Here is some text in a vertical-rl block flow. "
-          text run at (2,419) width 34: "The"
-          text run at (20,2) width 318: "block direction is right-to-left."
-        RenderBR {BR} at (34,320) size 0x0
-        RenderText {#text} at (38,2) size 324x18
-          text run at (38,2) width 324: "This line should also be vertical."
+        RenderText {#text} at (2,2) size 280x18
+          text run at (2,2) width 280: "Here is some text in a vertical-rl block flow. "
+          text run at (2,282) width 192: "The block direction is right-to-"
+          text run at (20,2) width 24: "left."
+        RenderBR {BR} at (34,26) size 0x0
+        RenderText {#text} at (38,2) size 203x18
+          text run at (38,2) width 203: "This line should also be vertical."
diff --git a/LayoutTests/platform/mac/fast/text/international/vertical-text-glyph-test-expected.checksum b/LayoutTests/platform/mac/fast/text/international/vertical-text-glyph-test-expected.checksum
index b7fdeb1..ce642bc 100644
--- a/LayoutTests/platform/mac/fast/text/international/vertical-text-glyph-test-expected.checksum
+++ b/LayoutTests/platform/mac/fast/text/international/vertical-text-glyph-test-expected.checksum
@@ -1 +1 @@
-386f323eb617f371186afe888df1ce4e
\ No newline at end of file
+97299ec70f0a6a19601d0cfd36516b65
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/text/international/vertical-text-glyph-test-expected.png b/LayoutTests/platform/mac/fast/text/international/vertical-text-glyph-test-expected.png
index 485cb50..d427525 100644
Binary files a/LayoutTests/platform/mac/fast/text/international/vertical-text-glyph-test-expected.png and b/LayoutTests/platform/mac/fast/text/international/vertical-text-glyph-test-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/text/international/vertical-text-glyph-test-expected.txt b/LayoutTests/platform/mac/fast/text/international/vertical-text-glyph-test-expected.txt
index af9326e..f0dd87e 100644
--- a/LayoutTests/platform/mac/fast/text/international/vertical-text-glyph-test-expected.txt
+++ b/LayoutTests/platform/mac/fast/text/international/vertical-text-glyph-test-expected.txt
@@ -1,25 +1,22 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x442
-  RenderBlock {HTML} at (0,0) size 800x442
-    RenderBody {BODY} at (8,18) size 784x415
-      RenderBlock {P} at (0,0) size 784x27
-        RenderText {#text} at (0,4) size 139x19
-          text run at (0,4) width 139: "Simple text path"
-      RenderBlock (anonymous) at (0,45) size 784x129
-        RenderBlock {SPAN} at (0,0) size 27x95
-          RenderText {#text} at (4,0) size 95x19
-            text run at (4,0) width 95: "ab\x{3042}\x{300C}\x{300D}\x{3002}"
-        RenderBR {BR} at (27,79) size 0x19
-        RenderBR {BR} at (0,106) size 0x19
-      RenderBlock {HR} at (0,183) size 784x2 [border: (1px inset #000000)]
-      RenderBlock {P} at (0,203) size 784x27
-        RenderText {#text} at (0,4) size 157x19
-          text run at (0,4) width 157: "Complex text path"
-      RenderBlock (anonymous) at (0,248) size 784x156
-        RenderBlock {SPAN} at (0,0) size 27x122
-          RenderText {#text} at (4,0) size 122x19
-            text run at (4,0) width 122: "ab\x{3042}\x{300C}\x{300D}\x{3002}1\x{20DD}"
-        RenderBR {BR} at (27,106) size 0x19
-        RenderBR {BR} at (0,133) size 0x19
-      RenderBlock {HR} at (0,413) size 784x2 [border: (1px inset #000000)]
+layer at (0,0) size 785x635
+  RenderView at (0,0) size 785x600
+layer at (0,0) size 785x635
+  RenderBlock {HTML} at (0,0) size 785x635
+    RenderBody {BODY} at (8,21) size 769x606
+      RenderBlock {P} at (0,0) size 769x32
+        RenderText {#text} at (0,5) size 161x21
+          text run at (0,5) width 161: "Simple text path"
+      RenderBlock (anonymous) at (0,53) size 769x235
+        RenderBlock {SPAN} at (0,0) size 32x226
+          RenderText {#text} at (5,0) size 226x21
+            text run at (5,0) width 226: "string\x{300C}\x{3042}\x{3001}\x{5909}\x{3063}\x{FF01}\x{300D}\x{3002}"
+        RenderText {#text} at (0,0) size 0x0
+      RenderBlock {HR} at (0,298) size 769x2 [border: (1px inset #000000)]
+      RenderBlock {P} at (0,321) size 769x32
+        RenderText {#text} at (0,5) size 181x21
+          text run at (0,5) width 181: "Complex text path"
+      RenderBlock (anonymous) at (0,374) size 769x232
+        RenderBlock {SPAN} at (0,0) size 32x223
+          RenderText {#text} at (5,0) size 223x21
+            text run at (5,0) width 223: "string\x{300C}\x{3042}\x{3001}\x{5909}\x{3063}\x{FF01}\x{300D}\x{3002}"
+        RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/platform/mac/fast/text/international/vertical-text-metrics-test-expected.txt b/LayoutTests/platform/mac/fast/text/international/vertical-text-metrics-test-expected.txt
index 9edca9f..ea0eef4 100644
--- a/LayoutTests/platform/mac/fast/text/international/vertical-text-metrics-test-expected.txt
+++ b/LayoutTests/platform/mac/fast/text/international/vertical-text-metrics-test-expected.txt
@@ -1,23 +1,23 @@
 Simple text path
 
-abあ「」。
-abあ「」。
-abあ「」。
-abあ「」。
+string「あ、変っ!」。
+string「あ、変っ!」。
+string「あ、変っ!」。
+string「あ、変っ!」。
 
 Complex text path
 
-abあ「」。1⃝
-abあ「」。1⃝
-abあ「」。1⃝
-abあ「」。1⃝
+string「あ、変っ!」。
+string「あ、変っ!」。
+string「あ、変っ!」。
+string「あ、変っ!」。
 
-width=93
-width=93
-width=27
-width=27
-width=103
-width=103
-width=27
-width=27
+width=223
+width=223
+width=32
+width=32
+width=223
+width=223
+width=32
+width=32
 
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8a8b29b..44a3e4d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-10-26  takano takumi  <takano1 at asia.apple.com>
+
+        Reviewed by Dave Hyatt.
+
+        Advances are wrong and glyphs are rotated improperly in vertical writing
+        https://bugs.webkit.org/show_bug.cgi?id=48315
+
+        We shouldn't use vertical metrics for Roman fonts. Also, we should rotate vertical variant
+        glyphs back on drawing as the whole run has already been rotated beforehand.
+
+        * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
+        (WebCore::FontPlatformData::FontPlatformData): Changed to ignore vertical orientation when the font doesn't support vertical metrics.
+        * platform/graphics/mac/FontMac.mm:
+        (WebCore::showGlyphsWithAdvances): Changed to rotate glyphs -90 degree for vertical variants.
+        (WebCore::Font::drawGlyphs):
+
 2010-10-26  Satish Sampath  <satish at chromium.org>
 
         Reviewed by Jeremy Orlow.
diff --git a/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm b/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm
index f3c5a37..dbfec5f 100644
--- a/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm
+++ b/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm
@@ -47,7 +47,6 @@ void FontPlatformData::loadFont(NSFont* nsFont, float, NSFont*& outNSFont, CGFon
 FontPlatformData::FontPlatformData(NSFont *nsFont, bool syntheticBold, bool syntheticOblique, FontOrientation orientation)
     : m_syntheticBold(syntheticBold)
     , m_syntheticOblique(syntheticOblique)
-    , m_orientation(orientation)
     , m_font(nsFont)
 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
     // FIXME: Chromium: The following code isn't correct for the Chromium port since the sandbox might
@@ -64,6 +63,26 @@ FontPlatformData::FontPlatformData(NSFont *nsFont, bool syntheticBold, bool synt
     CGFontRef cgFont = 0;
     loadFont(nsFont, m_size, m_font, cgFont, m_atsuFontID);
     
+    if (orientation == Vertical) {
+        // Ignore vertical orientation when the font doesn't support vertical metrics.
+        // The check doesn't look neat but this is what AppKit does for vertical writing...
+        RetainPtr<CFArrayRef> tableTags(AdoptCF, CTFontCopyAvailableTables(ctFont(), kCTFontTableOptionExcludeSynthetic));
+        CFIndex numTables = CFArrayGetCount(tableTags.get());
+        bool found = false;
+        for (CFIndex index = 0; index < numTables; ++index) {
+            CTFontTableTag tag = (CTFontTableTag)(uintptr_t)CFArrayGetValueAtIndex(tableTags.get(), index);
+            if (tag == kCTFontTableVhea || tag == kCTFontTableVORG) {
+                found = true;
+                break;
+            }
+        }
+
+        if (found == false)
+            orientation = Horizontal;
+    }
+
+    m_orientation = orientation;
+
     if (m_font)
         CFRetain(m_font);
 
diff --git a/WebCore/platform/graphics/mac/FontMac.mm b/WebCore/platform/graphics/mac/FontMac.mm
index 33a930b..377f9fa 100644
--- a/WebCore/platform/graphics/mac/FontMac.mm
+++ b/WebCore/platform/graphics/mac/FontMac.mm
@@ -47,10 +47,29 @@ bool Font::canReturnFallbackFontsForComplexText()
     return true;
 }
 
-static void showGlyphsWithAdvances(const FontPlatformData& font, CGContextRef context, const CGGlyph* glyphs, const CGSize* advances, size_t count)
+static void showGlyphsWithAdvances(const SimpleFontData* font, CGContextRef context, const CGGlyph* glyphs, const CGSize* advances, size_t count)
 {
-    if (!font.isColorBitmapFont())
+    const FontPlatformData& platformData = font->platformData();
+    if (!platformData.isColorBitmapFont()) {
+        CGAffineTransform savedMatrix;
+        bool isVertical = platformData.orientation() == Vertical;
+
+        if (isVertical) {
+            static const CGAffineTransform rotateLeftTransform = {0.0, -1.0, 1.0, 0.0, 0.0, 0.0};
+
+            savedMatrix = CGContextGetTextMatrix(context);
+            CGAffineTransform runMatrix = CGAffineTransformConcat(savedMatrix, rotateLeftTransform);
+            // Move start point to put glyphs into original region.
+            runMatrix.tx = savedMatrix.tx + font->ascent();
+            runMatrix.ty = savedMatrix.ty + font->descent();
+            CGContextSetTextMatrix(context, runMatrix);
+        }
+
         CGContextShowGlyphsWithAdvances(context, glyphs, advances, count);
+
+        if (isVertical)
+            CGContextSetTextMatrix(context, savedMatrix);
+    }
 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
     else {
         if (!count)
@@ -64,7 +83,7 @@ static void showGlyphsWithAdvances(const FontPlatformData& font, CGContextRef co
             positions[i].x = positions[i - 1].x + advance.width;
             positions[i].y = positions[i - 1].y + advance.height;
         }
-        CTFontDrawGlyphs(font.ctFont(), glyphs, positions.data(), count, context);
+        CTFontDrawGlyphs(platformData.ctFont(), glyphs, positions.data(), count, context);
     }
 #endif
 }
@@ -149,19 +168,19 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons
         Color shadowFillColor(shadowColor.red(), shadowColor.green(), shadowColor.blue(), shadowColor.alpha() * fillColor.alpha() / 255);
         context->setFillColor(shadowFillColor, fillColorSpace);
         CGContextSetTextPosition(cgContext, point.x() + shadowOffset.width(), point.y() + shadowOffset.height());
-        showGlyphsWithAdvances(platformData, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
+        showGlyphsWithAdvances(font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
         if (font->syntheticBoldOffset()) {
             CGContextSetTextPosition(cgContext, point.x() + shadowOffset.width() + font->syntheticBoldOffset(), point.y() + shadowOffset.height());
-            showGlyphsWithAdvances(platformData, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
+            showGlyphsWithAdvances(font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
         }
         context->setFillColor(fillColor, fillColorSpace);
     }
 
     CGContextSetTextPosition(cgContext, point.x(), point.y());
-    showGlyphsWithAdvances(platformData, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
+    showGlyphsWithAdvances(font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
     if (font->syntheticBoldOffset()) {
         CGContextSetTextPosition(cgContext, point.x() + font->syntheticBoldOffset(), point.y());
-        showGlyphsWithAdvances(platformData, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
+        showGlyphsWithAdvances(font, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
     }
 
     if (hasSimpleShadow)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list