Provide better Font fallbacks for DirectX backend
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Nov 2018 05:15:02 +0000 (05:15 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Nov 2018 05:15:02 +0000 (05:15 +0000)
commit669bd1c6cfa3ca1d5ab129cb7810dea2caf8f122
treef21eb1315103a2294d6a770a49b2f5ad69cf5bd3
parent4e92ac3aa2209c7908bd1dd70b98baa3b764d3f4
Provide better Font fallbacks for DirectX backend
https://bugs.webkit.org/show_bug.cgi?id=191412
<rdar://problem/45899207>

Reviewed by Zalan Bujtas.

Registration of custom fonts through GDI are not always visible
through the DirectWrite/GDI bridging layer. If a font is not located,
locate the closest matching avialable font rather than failing.

* platform/graphics/FontPlatformData.h:
* platform/graphics/win/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData): Use new font
fallback logic.
* platform/graphics/win/FontPlatformDataDirect2D.cpp:
(WebCore::FontPlatformData::platformDataInit):
(WebCore::FontPlatformData::platformIsEqual const):
(WebCore::FontPlatformData::createFallbackFont): Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237980 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/FontPlatformData.h
Source/WebCore/platform/graphics/win/FontCustomPlatformData.cpp
Source/WebCore/platform/graphics/win/FontPlatformDataDirect2D.cpp
Source/WebCore/platform/graphics/win/ImageBufferDirect2D.cpp