[OS X] Make checking if a font is the system font more robust
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Apr 2014 17:49:40 +0000 (17:49 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Apr 2014 17:49:40 +0000 (17:49 +0000)
commita9996740aaa9ca16994af771c17e8ee89d808acd
treebee94ee5d9fca33dcc8db19041eff8acac8020e5
parent2712dc701217573ac0e31ed3c21dad13ca06787d
[OS X] Make checking if a font is the system font more robust
https://bugs.webkit.org/show_bug.cgi?id=132030

Reviewed by Dean Jackson.

Instead of inspecting a font's name to determine if it is a system font,
on OS X we can ask the system directly.

This patch also moves a platform-specific check into platform-specific
code, so that other platforms don't check for OS X-specific behavior.

Covered by existing tests.

* platform/graphics/Font.cpp:
(WebCore::Font::hasValidAverageCharWidth):
* platform/graphics/Font.h:
* platform/graphics/mac/FontMac.mm:
(WebCore::Font::primaryFontDataIsSystemFont):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@167713 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/Font.cpp
Source/WebCore/platform/graphics/Font.h
Source/WebCore/platform/graphics/mac/FontMac.mm