[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 21:33:14 +0000 (21:33 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Apr 2014 21:33:14 +0000 (21:33 +0000)
commitcf17d35a54f23d73fa52bc622c1e07b4488c0661
treefa05f9fce59a80af2345cd360e3007e238638c58
parentab398afedf42d3be5dac3028a15f91d2eba4c184
[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@167724 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