[Cocoa] Stop crashing in lastResortFallbackFont()
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Jul 2018 18:34:24 +0000 (18:34 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Jul 2018 18:34:24 +0000 (18:34 +0000)
commit92a8f09df06c9916b656e03c423b35ebe4853f20
treed5b1ed73fdb9ee2f725581ca7646bd4e71d897c9
parent89fc83774629eabf2de0c152f9c28d01ee1cad6e
[Cocoa] Stop crashing in lastResortFallbackFont()
https://bugs.webkit.org/show_bug.cgi?id=187936

Reviewed by Jon Lee.

CoreText can get into a state where both Times and Lucida Grande are inaccessible.
Instead of crashing, we should use the real LastResort, which is backed by a section
in the .rodata of the CoreText dylib, and as such should always exist.

* platform/graphics/FontCache.cpp:
(WebCore::FontCache::fontForFamily):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontCache::lastResortFallbackFont):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234158 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/FontCache.cpp
Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp