Bug 200627 - [iOS 13] App-registered system wide fonts unavailable to WKWebView/Safari
Summary: [iOS 13] App-registered system wide fonts unavailable to WKWebView/Safari
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Text (show other bugs)
Version: Safari Technology Preview
Hardware: iPhone / iPad iOS 12
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-12 07:04 PDT by hacky
Modified: 2019-08-12 09:14 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hacky 2019-08-12 07:04:12 PDT
Overview:
---------
A font registered for system use using iOS 13 CTFontManagerRegisterFonts* API can't be used in WKWebView.


Steps to reproduce:
-------------------
App A is a font provider, app B is a font consumer using a WKWebView.

1. In App A: add Fonts/Install Fonts privilege.

2. In App A: Register a custom font for system use using new CTFontManagerRegisterFontsWithAssetNames() API. For example, font 'Montez-Regular' from Google Fonts.

3. Run App A and register the font. Verify it appears on decvice in Settings.app->General->Fonts.

3. In app B: add Fonts/Use Installed Fonts privilege.

4. Display UIFontPickerViewController. Verify Montez font appears corectly and selects correct UIFontDescriptor with postscriptName 'Montez-Regular'.

5. Verify font can be applied to a UILabel.

6. Try to apply font in in html, e.g.:
 `<body style="font-family: Montez-Regular;">hi</body>`
And load in a WKWebView as local file.


Actual Results:
---------------
Text is displayed using system default font.
In addition, attaching to Safari's web debugger shows the font doesn't appear in the list of available fonts in CSS properties editor.


Expected Results:
-----------------
Text will be displayed using custom font.


Build Date & Hardware:
----------------------
iOS 13.0 beta 5 (17A5556d) on iPad, iPhone (or simulator)


Additional Information:
-----------------------
Same behavior on Mobile Safari.
Submitted Feedback to Core Text team FB6958714
Comment 1 Alexey Proskuryakov 2019-08-12 09:14:40 PDT
User fonts are disabled in Safari as an anti-fingerprinting measure. Not sure if the same is expected behavior in WKWebView.