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

Issue 705580 link

Starred by 6 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug

Blocking:
issue pdfium:11



Sign in to add a comment

Japanese PDF rendered as Latin and Arabic

Project Member Reported by kojii@chromium.org, Mar 27 2017

Issue description

Chrome Version: 59.0.3049.0
OS: Win10

What steps will reproduce the problem?
(1) Open attached PDF
(2) Japanese text rendered as Latin and Arabic

What is the expected result?

Japanese text rendered. Other PDF viewers are fine.

Note, this is a manual PDF downloaded from SONY
http://www.sony.jp/ServiceArea/impdf/sc-smc-mc-8652.html
 
C0731006M-JP.pdf
73.8 KB Download
pdf-japanese-mojibake.png
23.3 KB View Download
Did this used to work? i.e. Does it work on Chrome 57 stable? It works for me on Linux with Chrome 57, FWIW.

Comment 2 by kojii@chromium.org, Mar 27 2017

It does work on 56.0.2924.87 and 57.0.2987.110, sorry for the lack of the information.
Thanks. I will bisect.
Cc: caryclark@google.com
r458793
Blocking: pdfium:11
Cc: -caryclark@google.com dsinclair@chromium.org
Owner: caryclark@google.com
Status: Assigned (was: Untriaged)
BTW, this doesn't repro on Linux at all.
Cc: thestig@chromium.org npm@chromium.org
I can't repro on Win 7 or Linux with pdfium_test. I'm building Chromium on each to see if I can repro there.

If anyone has access to a Win 10 machine, could you see if pdfium_test built against skiapaths renders this PDF correctly?
Same result as #1 on Linux -- w/ and w/o skiapaths, chrome print preview works fine.
 Issue 706410  has been merged into this issue.

Comment 10 by kojii@chromium.org, Mar 29 2017

Confirmed 59.0.3055.0 is fine on the same PC. Thank you for the fix.
Cc: bunge...@chromium.org
Chrome is building pdfium using chrome's skia BUILD.gn, which does not include some files in pdfium's BUILD.gn, notably SkFontMgr_custom.cpp.

PDFium talks directly to FreeType to get the font glyphs from the character code points, but then calls Skia to draw the text. When Skia is built for Chrome, it uses Windows instead of FreeType; the Windows font manager interface is unable to map the font.

When PDFium is built natively, Skia uses FreeType everywhere to match PDFium's use of FreeType.

Either:
- PDFium on Chrome needs to use a different Skia library, or
- Skia needs a runtime switch to choose the correct Font Manager, or
- PDFium needs to use Windows instead of FreeType to generate fonts and metrics

Investigating.
Note that SkFontMgr_custom.cpp was just recently added to Chromium's Windows build.
Re #12: Great! What needs to be done to PDFium within Chromium to fix this?
I think all you need is for PDFium to use SkFontMgr_New_Custom_Empty to create the font manager and then use that to create the SkTypeface. Note that such SkTypefaces will actually be drawn by FreeType.

I'm not sure what will happen to these fonts when we actually go to print; if Windows doesn't support the font format for some reason it seems the font may need to be printed as outlines or bitmaps. So if we fix the display side we should also check the actual print side.
Cc: sureshkumari@chromium.org rtoy@chromium.org
 Issue 708186  has been merged into this issue.

Sign in to add a comment