Bug 186366

Summary: [Cocoa] Allow app-bundled fonts to work in WKWebView
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: TextAssignee: Brady Eidson <beidson>
Status: NEW    
Severity: Normal CC: ap, mmaxfield, sam, simon.fraser, webkit-bug-importer, yousuke.igarashi
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Simon Fraser (smfr)
Reported 2018-06-06 15:48:51 PDT
Trying to load a custom font (which starts off encrypted) by creating a CGFontRef with CGFontCreateWithDataProvider(), then registering it in the app with CGFontManagerRegisterGraphicsFont(). The CSS landed in the WKWebView references the font just via font-family, but this doesn't work. We tried adding the font to the info.plist (under "Fonts provided by application") but this didn't' work (not clear if this is the PostScript name or the full name). It seems like a 3rd party app should be able to do this. What's the best way?
Attachments
Myles C. Maxfield
Comment 1 2018-06-18 15:37:03 PDT
iOS or macOS?
Myles C. Maxfield
Comment 2 2018-06-18 15:40:15 PDT
Are you sure you don't mean CTFontManagerRegisterGraphicsFont?
Myles C. Maxfield
Comment 3 2018-06-18 15:45:58 PDT
CTFontManagerRegisterGraphicsFont only registers it for the current process. On macOS, there are tons of ways to register a font for multiple processes. On iOS, the current only way is with a configuration profile. I do agree that it should be easier for an iOS application to register a font for its own process and the associated web processes, but not for unrelated other app processes.
Simon Fraser (smfr)
Comment 4 2018-06-19 15:31:10 PDT
iOS. And I do mean CGFontManagerRegisterGraphicsFont.
Simon Fraser (smfr)
Comment 5 2018-06-20 08:39:12 PDT
Oh, maybe I did mean CTFontManagerRegisterGraphicsFont(). I was confused by the fact that it takes a CGFontRef.
Radar WebKit Bug Importer
Comment 6 2018-06-20 16:50:20 PDT
Myles C. Maxfield
Comment 7 2018-06-20 21:28:48 PDT
Myles C. Maxfield
Comment 8 2018-06-26 14:34:14 PDT
Note You need to log in before you can comment on or make changes to this bug.