Print function does not support bold or italic for most Chinese font
Reported by
ilchenea...@gmail.com,
May 25 2016
|
||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36 Steps to reproduce the problem: 1. Open the test.html I attached here 2. print it use Chrome What is the expected behavior? The text "加粗" should be bold in print preview and print PDF What went wrong? The text "加粗" is not bold in print preview and print PDF Did this work before? Yes Before chrome switch from Webkit to Blink Chrome version: 50.0.2661.102 Channel: stable OS Version: 6.1 (Windows 7, Windows Server 2008 R2) Flash Version: Shockwave Flash 21.0 r0 The reason is that, most Chinese font does not have a bold or italic version. When rendering the HTML page, the bold/italic style for these font are calculated and generated by Chrome instead of using bold/italic font. While when printing, Chrome seems forget to generate the bold/italic style for those font.
,
Jun 15 2016
Likely a Windows only problem. It worked with Chromium 15.x, but is broken by 32.x. It comes out bold on Linux.
,
Jun 15 2016
Though I tried to bisect this and came out with r272270 bad / r272249 good. r272250 is a suspect, because it switched the Windows printing code to a new system, but it could also be r272260 which involves fonts. +folks from r272260. Maybe they can take the bug or refute my suspicions. I suppose we could try to build 2 year old Chromium to see whose fault it actually is, but doing that, on Windows especially, sounds like a bad idea.
,
Jun 15 2016
I doubt that it would be r272260 ("More or less implement RenderTextHarfBuzz"). That CL only enabled RenderTextHarfBuzz behind a flag, though it did refactor a shared function, SkiaTextRenderer::SetFontFamilyWithStyle, which still looks right to me. +scottmg, vitalybuka to comment on r272250.
,
Jun 15 2016
I agree, r272250 seems more likely.
,
Jun 15 2016
r272250 generates emf files in utility process instead of renderer. Probably utility process needs some additional font initialization.
,
Jun 15 2016
Thanks for the info. I guess I can take this one.
,
Jun 30 2016
halcanary: Can you try print preview -> Save as PDF on Windows and look at the output PDF? Even that fails to render "加粗" as bold text.
,
Jul 25 2016
reproduced. Is this "fake bold"? I'll take a look at Skia.
,
Jul 25 2016
,
Jul 25 2016
Looking at it more, The fake bold bit doesn't seem to be set. When I use the exact same glyphs in bolds and a not-bold typeface, the PDF has identical fonts.
,
Jul 27 2016
According to bungeman@, the "bold" font here is a synthetic bold created by DirectWrite. When SkPDF asks for the original typeface data, we get the un-bolded original, with no way to know that it should be fake-bolded.
,
Sep 9 2016
It seems to us that we have the same problem see Issue 639198 . My question is, do you make any progress? With which Chrome Version we can expect a working solution?
,
Sep 9 2016
SkPDF just needs a way to query the typeface SkTypeface::isSyntheticBold() SkTypface::isSyntheticItalic().
,
Sep 10 2016
,
Sep 10 2016
halcanary: Does that mean you can take the bug?
,
Sep 12 2016
bungeman@ is the expert on typefaces.
,
Sep 13 2016
bungeman@ has a potential fix in the works. I will test as soon as he sends me a CL.
,
Sep 13 2016
The following revision refers to this bug: https://skia.googlesource.com/skia.git/+/0b7758236ca81337aa465a9f61cf466f03718862 commit 0b7758236ca81337aa465a9f61cf466f03718862 Author: bungeman <bungeman@google.com> Date: Tue Sep 13 21:03:54 2016 Simulated fonts aren't TrueType fonts. Some font back-ends provide simulated fonts such as fake bold or fake oblique. These fonts should not be reported as TrueType, since the font data isn't what is actually used to draw the glyphs. BUG= chromium:639198 BUG= chromium:614612 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2333423002 Review-Url: https://codereview.chromium.org/2333423002 [modify] https://crrev.com/0b7758236ca81337aa465a9f61cf466f03718862/src/ports/SkFontMgr_fontconfig.cpp [modify] https://crrev.com/0b7758236ca81337aa465a9f61cf466f03718862/src/ports/SkTypeface_win_dw.cpp
,
Apr 9 2018
I'm pretty sure this is fixed at this point. |
||||||||||
►
Sign in to add a comment |
||||||||||
Comment 1 by ashej...@chromium.org
, May 25 2016