New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 614612 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Print function does not support bold or italic for most Chinese font

Reported by ilchenea...@gmail.com, May 25 2016

Issue description

UserAgent: 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.
 
test.html
274 bytes View Download
Components: Internals>Printing
Status: Untriaged (was: Unconfirmed)
Summary: Print function does not support bold or italic for most Chinese font (was: Print function does not support bold or italicfor most Chinese font )
Likely a Windows only problem. It worked with Chromium 15.x, but is broken by 32.x.

It comes out bold on Linux.
Cc: asvitk...@chromium.org ckocagil@chromium.org msw@chromium.org
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.

Comment 4 by msw@chromium.org, Jun 15 2016

Cc: vitalyb...@chromium.org scottmg@chromium.org
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.
I agree, r272250 seems more likely.
r272250 generates emf files in utility process instead of renderer.
Probably utility process needs some additional font initialization.
Cc: -ckocagil@chromium.org -msw@chromium.org -vitalyb...@chromium.org -asvitk...@chromium.org -scottmg@chromium.org caryclark@google.com
Owner: thestig@chromium.org
Status: Assigned (was: Untriaged)
Thanks for the info. I guess I can take this one.
Cc: halcanary@chromium.org
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.
reproduced.

Is this "fake bold"?

I'll take a look at Skia.
Cc: -caryclark@google.com bunge...@chromium.org carycl...@google.comm
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.
chromium_issue_614612_b.pdf
55.9 KB Download
chromium_issue_614612_b.html
222 bytes View Download
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.

Comment 13 by 3ue...@gmail.com, 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?
SkPDF just needs a way to query the typeface SkTypeface::isSyntheticBold() SkTypface::isSyntheticItalic().
Cc: -carycl...@google.comm caryclark@google.com
halcanary: Does that mean you can take the bug?
bungeman@ is the expert on typefaces.
Cc: -bunge...@chromium.org
Owner: bunge...@chromium.org
Status: Started (was: Assigned)
bungeman@ has a potential fix in the works. I will test as soon as he sends me a CL.
Project Member

Comment 19 by bugdroid1@chromium.org, 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

Status: Fixed (was: Started)
I'm pretty sure this is fixed at this point.

Sign in to add a comment