Fonts are replaced by Times New Roman when DirectWrite is used
Reported by
tomas.ba...@gmail.com,
Oct 12 2017
|
||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 Example URL: Steps to reproduce the problem: 1. Crate a webpage using a specific font (Serpentine, Arial Rounded MT, Eras ITC...) 2. Times is displayed instead What is the expected behavior? Display the font correctly like IE What went wrong? The problem is caused by the fact that DirectWrite font family name may be different from GDI font family name, but in CSS specs it is (of course) not specified, which font family name to use. Thus when looking-up the DW font to use, we should check the GDI font names as well. Eg. the font family of the attached Serpentine font is 'Serpentine' in GDI, but 'Serpentine BoldItalic' in DirectWrite. The problem is nicely described here: https://blogs.msdn.microsoft.com/text/2009/04/15/introducing-the-directwrite-font-system/ An ugly workaround is actually present in FontCacheSkiaWin.cpp in the createFontPlatformData() - the typefacesHasWeightSuffix() and typefacesHasStretchSuffix() functions are called here - they try to remove the suffixes from the GDI family to create a DW family - it works for example with Segoe UI Light, but not Segoe UI Semilight (the 'semilight' suffix is missing in the suffixes list - and the 'extrablack' or 'ultrablack' are missing as well). But this workaround completely fails for fonts like the Serpentine attached (the DW family has a 'BoldItalic' suffix, but GDI has none) or Eras ITC (which family is 'Eras Bold ITC' or 'Eras Light ITC' in GDI, so it is not a suffix at all) The solution is fairy simple - It is possible to create a LOGFONT with the GDI family name and then call IDWriteGdiInterop::CreateFontFromLOGFONT to create a DW font without having to try to trim some suffixes. The workaround in older Chromes was to disable DirectWrite, but it is not possible now Does it occur on multiple sites: Yes Is it a problem with a plugin? No Did this work before? N/A Does this work in other browsers? Yes Chrome version: 61.0.3163.100 Channel: stable OS Version: 10.0 Flash Version:
,
Oct 14 2017
,
Oct 14 2017
Thanks for the detail report. Sadly the suggested workaround won't work as we can't create a LOGFONT from within the sandbox.
,
Oct 15
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Oct 21
|
||||
►
Sign in to add a comment |
||||
Comment 1 by bokan@chromium.org
, Oct 12 2017