Title: [147449] tags/Safari-537.35.6/Source/WebCore

Diff

Modified: tags/Safari-537.35.6/Source/WebCore/ChangeLog (147448 => 147449)


--- tags/Safari-537.35.6/Source/WebCore/ChangeLog	2013-04-02 17:41:15 UTC (rev 147448)
+++ tags/Safari-537.35.6/Source/WebCore/ChangeLog	2013-04-02 17:45:40 UTC (rev 147449)
@@ -1,5 +1,30 @@
 2013-04-01  Lucas Forschler  <[email protected]>
 
+        Merge r146995
+
+    2013-03-27  Dean Jackson  <[email protected]>
+
+            [Mac] Use fontName rather than familyName for internal fonts
+            https://bugs.webkit.org/show_bug.cgi?id=113392
+            <rdar://problem/13474743>
+
+            Reviewed by Enrica Casucci.
+
+            Some internal fonts on OS X have a family name that
+            isn't listed in availableFontFamilies. In this case
+            we should use the font name rather than the family
+            name when looking for a match.
+
+            * platform/mac/ThemeMac.h: NSFont category to provide a web-friendly family name.
+            * platform/mac/ThemeMac.mm:
+            (-[NSFont webCoreFamilyName]): Returns the font name for internal fonts, otherwise the family name.
+            (WebCore::ThemeMac::controlFont):
+            * rendering/RenderThemeMacShared.mm: Use the webCoreFamilyName.
+            (WebCore::RenderThemeMacShared::systemFont): Ditto.
+            (WebCore::RenderThemeMacShared::setFontFromControlSize): Ditto.
+
+2013-04-01  Lucas Forschler  <[email protected]>
+
         Merge r147287
 
     2013-03-31  Brady Eidson  <[email protected]>

Modified: tags/Safari-537.35.6/Source/WebCore/platform/mac/ThemeMac.h (147448 => 147449)


--- tags/Safari-537.35.6/Source/WebCore/platform/mac/ThemeMac.h	2013-04-02 17:41:15 UTC (rev 147448)
+++ tags/Safari-537.35.6/Source/WebCore/platform/mac/ThemeMac.h	2013-04-02 17:45:40 UTC (rev 147449)
@@ -28,6 +28,10 @@
 
 #include "Theme.h"
 
+@interface NSFont(WebCoreTheme)
+- (NSString*)webCoreFamilyName;
+@end
+
 namespace WebCore {
 
 class ThemeMac : public Theme {

Modified: tags/Safari-537.35.6/Source/WebCore/platform/mac/ThemeMac.mm (147448 => 147449)


--- tags/Safari-537.35.6/Source/WebCore/platform/mac/ThemeMac.mm	2013-04-02 17:41:15 UTC (rev 147448)
+++ tags/Safari-537.35.6/Source/WebCore/platform/mac/ThemeMac.mm	2013-04-02 17:45:40 UTC (rev 147449)
@@ -78,6 +78,18 @@
 
 @end
 
+@implementation NSFont (WebCoreTheme)
+
+- (NSString*)webCoreFamilyName
+{
+    if ([[self familyName] hasPrefix:@"."])
+        return [self fontName];
+
+    return [self familyName];
+}
+
+@end
+
 // FIXME: Default buttons really should be more like push buttons and not like buttons.
 
 namespace WebCore {
@@ -595,7 +607,7 @@
             fontDescription.setGenericFamily(FontDescription::SerifFamily);
 
             NSFont* nsFont = [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:controlSizeForFont(font)]];
-            fontDescription.firstFamily().setFamily([nsFont familyName]);
+            fontDescription.firstFamily().setFamily([nsFont webCoreFamilyName]);
             fontDescription.setComputedSize([nsFont pointSize] * zoomFactor);
             fontDescription.setSpecifiedSize([nsFont pointSize] * zoomFactor);
             return fontDescription;

Modified: tags/Safari-537.35.6/Source/WebCore/rendering/RenderThemeMacShared.mm (147448 => 147449)


--- tags/Safari-537.35.6/Source/WebCore/rendering/RenderThemeMacShared.mm	2013-04-02 17:41:15 UTC (rev 147448)
+++ tags/Safari-537.35.6/Source/WebCore/rendering/RenderThemeMacShared.mm	2013-04-02 17:45:40 UTC (rev 147449)
@@ -282,7 +282,7 @@
         NSFontManager *fontManager = [NSFontManager sharedFontManager];
         cachedDesc->setIsAbsoluteSize(true);
         cachedDesc->setGenericFamily(FontDescription::NoFamily);
-        cachedDesc->firstFamily().setFamily([font familyName]);
+        cachedDesc->firstFamily().setFamily([font webCoreFamilyName]);
         cachedDesc->setSpecifiedSize([font pointSize]);
         cachedDesc->setWeight(toFontWeight([fontManager weightOfFont:font]));
         cachedDesc->setItalic([fontManager traitsOfFont:font] & NSItalicFontMask);
@@ -689,7 +689,7 @@
     fontDescription.setGenericFamily(FontDescription::SerifFamily);
 
     NSFont* font = [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:controlSize]];
-    fontDescription.firstFamily().setFamily([font familyName]);
+    fontDescription.firstFamily().setFamily([font webCoreFamilyName]);
     fontDescription.setComputedSize([font pointSize] * style->effectiveZoom());
     fontDescription.setSpecifiedSize([font pointSize] * style->effectiveZoom());
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to