Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.8.0 Alpha
-
None
-
macOS 10.11.5, XCode 7.3.1
-
ceff67e0bab4d34c5b791d1f1b1d43c7a4e44d84
Description
During execution of the qwebenginepage renderWidgetHostViewNotShowTopLevel test, the following error messages can be seen on macOS when the wikipedia frontpage is loaded:
[26700:34119:1128/143504:ERROR:font_loader.mm(64)] Failed to load font NotoSansSyriacEastern [26701:1295:1128/143504:ERROR:renderer_blink_platform_impl.cc(575)] Bad response from RenderProcessHostMsg_LoadFont() for NotoSansSyriacEastern [26701:1295:1128/143504:ERROR:FontPlatformDataMac.mm(92)] Loading user font ".LastResort" from non system location failed. Corrupt or missing font file? [26701:1295:1128/143504:ERROR:FontDataCache.cpp(56)] Empty typeface() in FontPlatformData when accessing FontDataCache. [26700:34119:1128/143505:ERROR:font_loader.mm(64)] Failed to load font NotoSansGlagolitic [26701:1295:1128/143505:ERROR:renderer_blink_platform_impl.cc(575)] Bad response from RenderProcessHostMsg_LoadFont() for NotoSansGlagolitic [26701:1295:1128/143505:ERROR:FontPlatformDataMac.mm(92)] Loading user font ".LastResort" from non system location failed. Corrupt or missing font file? [26701:1295:1128/143505:ERROR:FontDataCache.cpp(56)] Empty typeface() in FontPlatformData when accessing FontDataCache.
After a lengthy discovery process, this happens because the test application is a regular executable not packed into a macOS bundle (e.g. testName.app).
The offending line in the Chromium source directory is in
src/3rdparty/chromium/content/common/mac/font_descriptor.mm:23
inside the FontDescriptor::ToNSFont() method.
Specifically [NSFont fontWithName:size] is called to load the "NotoSansSyriacEastern" font, but the return value is nil.
If the same call is done from a bundled app, the return value is a correct NSFont object.
The font in question resides in a semi-standard location in
/Library/Application\ Support/Apple/Fonts/Language\ Support/NotoSansSyriacEastern-Regular.ttf
and for some mysterious reason the loadFont method considers that location only if the application is executed from inside a bundle.
The aforementioned font is considered as a fallback font by Chromium, and is chosen by Blink in
src/3rdparty/chromium/third_party/WebKit/Source/platform/fonts/mac/FontCacheMac.mm:128
It uses the private API call
[NSFont findFontLike:forCharacter:inLanguage]
which appears to take into account the semi-standard folder.
Attachments
For Gerrit Dashboard: QTBUG-57354 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
178749,5 | Fix font load error messages inside non-app-bundle tests | 5.8 | qt/qtwebengine | Status: MERGED | +2 | 0 |