Move Blink Windows 8 and below fallback to OOP Mojo fallback APIs
Organise Blink font fallback into two main functions: * Retrieving a fallback font from the legacy path which finds a fallback font from hard-coded lists that have been curated manually and maintained. * Retrieving a fallback font through DWrite fallback API, either by calling Skia API in-process, which in turn uses DWriteFontProxy out of process bridging, or calling a Mojo method to retrieve a fallback family name. Use the LegacyWindowsDWriteFontFallbackEnabled RunTimeEnabledFeature to decide which fallback font to return, if the flag is on, always use DWrite. If the flag is off, on Windows 8 and below, only use the hard-coded fallback path. On Windows 8.1 and above, prioritze the hard-coded path, but try the API path if the hard-coded path did not find a result. This is intended as an interim flag to control which fallback font code path to use and to measure quality and availability of fallback fonts in the new code path. The flag is to be removed once we are confident to switch to the new code. Add UMA metric to record 4 different cases * Legacy hard-coded list did not find a font * API based fallback did not find a font * No font was found by either * Legacy fallback and API fallback disagreed on fallback font Record these metrics per ICU UBlockCode. Using API based fallback leads to a number of improvements exposed by some of our tests. For Japanese locales, Yu Gothic UI is selected in favor of Yu Gothic, which chooses the better screen-optimized, more modern variant of the font (fast/text/international/001.html, fast/text/international/002.html, fast/text/international/wrap-CJK-001.html). For traditional Chinese, YaHeng UI is selected in favor of SimSun, improving screen display of Chinese ideographs ( fast/text/justify-ideograph-complex.html, fast/text/justify-ideograph-simple.html). For untagged Han ideographs, Yu Gothic UI and Microsoft JhengHei UI are chosen vs. SimSun-ExtB and SimSun before. For Thai, Leelawade UI is selected over Tahoma. So, with less hand-curated fonts and removing code, we get much improved CJK and Thai fallback. Brief design doc linked from the bug. Bug: 976737 Change-Id: I3adff65cddb50061c884b81a3ae00de75d4ba735 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1708138 Commit-Queue: Dominik Röttsches <drott@chromium.org> Reviewed-by:Stephen Chenney <schenney@chromium.org> Reviewed-by:
Koji Ishii <kojii@chromium.org> Reviewed-by:
Emil A Eklund <eae@chromium.org> Cr-Commit-Position: refs/heads/master@{#687373}
Showing
This diff is collapsed.
4.06 KB




File moved
4.62 KB
3.05 KB