Follow-up fix for <rdar://problem/10191243> Glyph variants (line final swashes) appea...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Sep 2011 23:12:02 +0000 (23:12 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Sep 2011 23:12:02 +0000 (23:12 +0000)
Reviewed by Simon Fraser.

Source/WebCore:

* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::ctFont): Check for Hoefler Text Black Italic as well.

LayoutTests:

Added Hoefler Text Black Italic to the test case.

* fast/text/line-initial-and-final-swashes.html:
* platform/mac/fast/text/line-initial-and-final-swashes-expected.png:
* platform/mac/fast/text/line-initial-and-final-swashes-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@96374 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/text/line-initial-and-final-swashes.html
LayoutTests/platform/mac/fast/text/line-initial-and-final-swashes-expected.png
LayoutTests/platform/mac/fast/text/line-initial-and-final-swashes-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm

index 6b8df97..76ede63 100644 (file)
@@ -1,3 +1,15 @@
+2011-09-29  Dan Bernstein  <mitz@apple.com>
+
+        Follow-up fix for <rdar://problem/10191243> Glyph variants (line final swashes) appear where they should not
+
+        Reviewed by Simon Fraser.
+
+        Added Hoefler Text Black Italic to the test case.
+
+        * fast/text/line-initial-and-final-swashes.html:
+        * platform/mac/fast/text/line-initial-and-final-swashes-expected.png:
+        * platform/mac/fast/text/line-initial-and-final-swashes-expected.txt:
+
 2011-09-29  Adam Barth  <abarth@webkit.org>
 
         This test can also time out.
index aa49e29..89033a6 100644 (file)
@@ -1,7 +1,11 @@
 <p>
-    The blue text should be identical to, and overlap, the red text, so there should be no red pixels below.
+    The black text should be identical to, and overlap, the red text, so there should be no red pixels below.
 </p>
 <div style="font-size: 144px; font-family: Hoefler Text; font-style: italic; -webkit-font-smoothing: none;">
     <div style="color: red;">v a&#x0300; e</div>
     <div style="margin-top: -144px;">v &#xe0; e</div>
 </div>
+<div style="font-size: 144px; font-family: Hoefler Text; font-style: italic; font-weight: bold; -webkit-font-smoothing: none;">
+    <div style="color: red;">v a&#x0300; e</div>
+    <div style="margin-top: -144px;">v &#xe0; e</div>
+</div>
index bcf3cea..9ec706b 100644 (file)
Binary files a/LayoutTests/platform/mac/fast/text/line-initial-and-final-swashes-expected.png and b/LayoutTests/platform/mac/fast/text/line-initial-and-final-swashes-expected.png differ
index 1910ef9..106fa7a 100644 (file)
@@ -4,8 +4,8 @@ layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
       RenderBlock {P} at (0,0) size 784x18
-        RenderText {#text} at (0,0) size 635x18
-          text run at (0,0) width 635: "The blue text should be identical to, and overlap, the red text, so there should be no red pixels below."
+        RenderText {#text} at (0,0) size 642x18
+          text run at (0,0) width 642: "The black text should be identical to, and overlap, the red text, so there should be no red pixels below."
       RenderBlock {DIV} at (0,34) size 784x144
         RenderBlock {DIV} at (0,0) size 784x144 [color=#FF0000]
           RenderText {#text} at (0,0) size 256x144
@@ -13,3 +13,10 @@ layer at (0,0) size 800x600
         RenderBlock {DIV} at (0,0) size 784x144
           RenderText {#text} at (0,0) size 256x144
             text run at (0,0) width 256: "v \x{E0} e"
+      RenderBlock {DIV} at (0,178) size 784x144
+        RenderBlock {DIV} at (0,0) size 784x144 [color=#FF0000]
+          RenderText {#text} at (0,0) size 293x144
+            text run at (0,0) width 293: "v a\x{300} e"
+        RenderBlock {DIV} at (0,0) size 784x144
+          RenderText {#text} at (0,0) size 293x144
+            text run at (0,0) width 293: "v \x{E0} e"
index 5ae670b..9ce8dd3 100644 (file)
@@ -1,3 +1,12 @@
+2011-09-29  Dan Bernstein  <mitz@apple.com>
+
+        Follow-up fix for <rdar://problem/10191243> Glyph variants (line final swashes) appear where they should not
+
+        Reviewed by Simon Fraser.
+
+        * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
+        (WebCore::FontPlatformData::ctFont): Check for Hoefler Text Black Italic as well.
+
 2011-09-29  Cary Clark  <caryclark@google.com>
 
         Enable LCD text in Skia on Mac
index 906405b..7b13608 100644 (file)
@@ -252,7 +252,7 @@ CTFontRef FontPlatformData::ctFont() const
         CTFontDescriptorRef fontDescriptor;
         RetainPtr<CFStringRef> postScriptName(AdoptCF, CTFontCopyPostScriptName(m_CTFont.get()));
         // Hoefler Text Italic has line-initial and -final swashes enabled by default, so disable them.
-        if (CFEqual(postScriptName.get(), CFSTR("HoeflerText-Italic")))
+        if (CFEqual(postScriptName.get(), CFSTR("HoeflerText-Italic")) || CFEqual(postScriptName.get(), CFSTR("HoeflerText-BlackItalic")))
             fontDescriptor = cascadeToLastResortAndDisableSwashesFontDescriptor();
         else
             fontDescriptor = cascadeToLastResortFontDescriptor();