A disallowed user-installed font may be used if its PostScript name is specified
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Jan 2018 09:01:28 +0000 (09:01 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Jan 2018 09:01:28 +0000 (09:01 +0000)
commit46ab5490ff467799112ba16cc15adf9e1c475c85
tree6eea2d18d150e56e3f6b7e1c799d657b7ee0d924
parentd40b2e1066d4373ea82a945293e796b24702cab1
A disallowed user-installed font may be used if its PostScript name is specified
https://bugs.webkit.org/show_bug.cgi?id=180951

Reviewed by Brent Fulgham.

Source/WebCore:

This patch adds a new CoreText font attribute, kCTFontFallbackOptionAttribute, to the
fonts which WebKit creates. It also adds this attribute to web fonts, so that font
fallback will happen according to our rules about user-installed fonts. It also marks
these font attributes as "mandatory" so CoreText will be guaranteed to follow the
policy.

Test: fast/text/user-installed-fonts/disable.html

* platform/graphics/FontCache.h:
(WebCore::FontDescriptionKey::makeFlagsKey):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontDatabase::collectionForFamily):
(WebCore::FontDatabase::fontForPostScriptName):
(WebCore::addAttributesForUserInstalledFonts):
(WebCore::mandatoryAttributesForUserInstalledFonts):
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):

Source/WebCore/PAL:

* pal/spi/cocoa/CoreTextSPI.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227776 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/platform/mac/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/pal/spi/cocoa/CoreTextSPI.h
Source/WebCore/platform/graphics/FontCache.h
Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.h
Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp