Title: [98765] trunk
Revision
98765
Author
[email protected]
Date
2011-10-28 14:41:43 -0700 (Fri, 28 Oct 2011)

Log Message

<rdar://problem/10288006> Emoji characters are too close to each other in small font size

Reviewed by Sam Weinig.

Source/WebCore: 

* platform/graphics/mac/SimpleFontDataMac.mm:
(WebCore::SimpleFontData::platformWidthForGlyph): If the font is a color bitmap font, use
-[NSFont advancementForGlyph:] instead of wkGetGlyphTransformedAdvances().

LayoutTests: 

* platform/mac/fast/css/font-family-pictograph-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (98764 => 98765)


--- trunk/LayoutTests/ChangeLog	2011-10-28 21:30:44 UTC (rev 98764)
+++ trunk/LayoutTests/ChangeLog	2011-10-28 21:41:43 UTC (rev 98765)
@@ -1,3 +1,11 @@
+2011-10-28  Dan Bernstein  <[email protected]>
+
+        <rdar://problem/10288006> Emoji characters are too close to each other in small font size
+
+        Reviewed by Sam Weinig.
+
+        * platform/mac/fast/css/font-family-pictograph-expected.txt:
+
 2011-10-28  Ken Buchanan <[email protected]>
 
         Crash when splitting inline flows with generated floats

Modified: trunk/LayoutTests/platform/mac/fast/css/font-family-pictograph-expected.txt (98764 => 98765)


--- trunk/LayoutTests/platform/mac/fast/css/font-family-pictograph-expected.txt	2011-10-28 21:30:44 UTC (rev 98764)
+++ trunk/LayoutTests/platform/mac/fast/css/font-family-pictograph-expected.txt	2011-10-28 21:41:43 UTC (rev 98765)
@@ -4,5 +4,5 @@
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
       RenderBlock {DIV} at (0,0) size 784x95
-        RenderText {#text} at (0,0) size 72x95
-          text run at (0,0) width 72: "\x{2665}"
+        RenderText {#text} at (0,0) size 73x95
+          text run at (0,0) width 73: "\x{2665}"

Modified: trunk/Source/WebCore/ChangeLog (98764 => 98765)


--- trunk/Source/WebCore/ChangeLog	2011-10-28 21:30:44 UTC (rev 98764)
+++ trunk/Source/WebCore/ChangeLog	2011-10-28 21:41:43 UTC (rev 98765)
@@ -1,3 +1,13 @@
+2011-10-28  Dan Bernstein  <[email protected]>
+
+        <rdar://problem/10288006> Emoji characters are too close to each other in small font size
+
+        Reviewed by Sam Weinig.
+
+        * platform/graphics/mac/SimpleFontDataMac.mm:
+        (WebCore::SimpleFontData::platformWidthForGlyph): If the font is a color bitmap font, use
+        -[NSFont advancementForGlyph:] instead of wkGetGlyphTransformedAdvances().
+
 2011-10-28  Adam Barth  <[email protected]>
 
         Remove unused default constructor

Modified: trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm (98764 => 98765)


--- trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm	2011-10-28 21:30:44 UTC (rev 98764)
+++ trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm	2011-10-28 21:41:43 UTC (rev 98765)
@@ -400,12 +400,16 @@
 {
     CGSize advance = CGSizeZero;
     if (platformData().orientation() == Horizontal || m_isBrokenIdeographFallback) {
-        NSFont* font = platformData().font();
-        float pointSize = platformData().m_size;
-        CGAffineTransform m = CGAffineTransformMakeScale(pointSize, pointSize);
-        if (!wkGetGlyphTransformedAdvances(platformData().cgFont(), font, &m, &glyph, &advance)) {
-            LOG_ERROR("Unable to cache glyph widths for %@ %f", [font displayName], pointSize);
-            advance.width = 0;
+        NSFont *font = platformData().font();
+        if (font && platformData().isColorBitmapFont())
+            advance = [font advancementForGlyph:glyph];
+        else {
+            float pointSize = platformData().m_size;
+            CGAffineTransform m = CGAffineTransformMakeScale(pointSize, pointSize);
+            if (!wkGetGlyphTransformedAdvances(platformData().cgFont(), font, &m, &glyph, &advance)) {
+                LOG_ERROR("Unable to cache glyph widths for %@ %f", [font displayName], pointSize);
+                advance.width = 0;
+            }
         }
     } else
         CTFontGetAdvancesForGlyphs(m_platformData.ctFont(), kCTFontVerticalOrientation, &glyph, &advance, 1);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to