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

Issue 781785 link

Starred by 2 users

Issue metadata

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



Sign in to add a comment

Chrome browser issue: pdf with japanese font not rendering correctly

Project Member Reported by marcore@chromium.org, Nov 6 2017

Issue description

Chrome version: 62.0.3202.75(Official Build)(64 bit)
OS version: Windows10 Enterprise 64bit Ver.1607
Case#: 14051882

Description: Attached PDF file is garbled only on Chrome browser

Steps to reproduce: open with Chrome the attached file 
https://drive.google.com/open?id=18p1oyHgBfUkJ3W6bVHaeKHxtl9bPCOFV

Current Behavior / Reproduction: 
the pdf is not displayed correctly
https://drive.google.com/open?id=1slGF-XVRBpmTAVLTJT6y8FXmb_-Rd2LB

Expected Behavior: 
in other browser is displayed correctly:
https://drive.google.com/open?id=1xJFHCGvLmVs5LvgsTj8tSbb-oq1yPYGD
Drive link to logs: 
https://drive.google.com/open?id=1WHxePDaubj1KgrGfARgxWEpfyn4fkymS

On the windows system I've the fonts used in the pdf:
MeiryoUI and MS-Gothic

 
Labels: M-64 M-62
Owner: npm@chromium.org
Status: Assigned (was: Untriaged)
npm@ would you be able to take a look and see what's happening?
In the PDF, the fonts mentioned are not embedded, so it's up to the PDF viewer to do best effort font substitution. Thus there is no guarantee the PDF will display correctly. e.g. What happens if the OS does not have Japanese fonts? The software that generated the PDF should embed those fonts. That said, it looks like we have room for improvement with font substitution on Windows.

- On Windows, I see this problem even though I have several fonts with "Gothic" in the name.
- On Mac, the PDF displays, though the font used is different from the one Preview.app picked.
- On Linux machine, the PDF displays correctly. (I have Japanese fonts installed.)
- On ChromeOS it displays correctly.

Comment 4 by npm@chromium.org, Nov 6 2017

I got a fix (although I need to check it doesn't break other stuff). Question for bug reporter: is it OK to add that PDF to our (open-source) testing/corpus directory?
@thestig I've advised the customer to use PDF/A-1a (ISO 19005-1)
@npm I've asked the customer the authorization

Project Member

Comment 6 by bugdroid1@chromium.org, Nov 7 2017

The following revision refers to this bug:
  https://pdfium.googlesource.com/pdfium/+/979e916fde750e47f262c59dc75f4ca2dc19ed39

commit 979e916fde750e47f262c59dc75f4ca2dc19ed39
Author: Nicolas Pena <npm@chromium.org>
Date: Tue Nov 07 16:32:20 2017

Remove m_bFlagExact from CFX_SubstFont

This CL removes the single use case from |m_bFlagExact|. This flag
allows the PDF viewer to treat a substitute font with a matching name as
if it was actually an embedded font, which is wrong. For all substitute
fonts, it is important to follow the longer process of first obtaining
the unicode from the charcode to then obtain the glyph in the substitute
font that corresponds to that unicode.

Bug:  chromium:781785 
Change-Id: Ie5958b43914e0e46334b89b7c2c55c02d0da0c11
Reviewed-on: https://pdfium-review.googlesource.com/17859
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>

[modify] https://crrev.com/979e916fde750e47f262c59dc75f4ca2dc19ed39/xfa/fgas/font/cfgas_fontmgr.cpp
[modify] https://crrev.com/979e916fde750e47f262c59dc75f4ca2dc19ed39/core/fxge/cfx_substfont.h
[modify] https://crrev.com/979e916fde750e47f262c59dc75f4ca2dc19ed39/core/fxge/cfx_font.cpp
[modify] https://crrev.com/979e916fde750e47f262c59dc75f4ca2dc19ed39/core/fxge/cfx_folderfontinfo.cpp
[modify] https://crrev.com/979e916fde750e47f262c59dc75f4ca2dc19ed39/core/fxge/apple/fx_mac_imp.cpp
[modify] https://crrev.com/979e916fde750e47f262c59dc75f4ca2dc19ed39/core/fxge/ifx_systemfontinfo.h
[modify] https://crrev.com/979e916fde750e47f262c59dc75f4ca2dc19ed39/public/fpdf_sysfontinfo.h
[modify] https://crrev.com/979e916fde750e47f262c59dc75f4ca2dc19ed39/core/fxge/fx_ge_linux.cpp
[modify] https://crrev.com/979e916fde750e47f262c59dc75f4ca2dc19ed39/core/fxge/win32/fx_win32_device.cpp
[modify] https://crrev.com/979e916fde750e47f262c59dc75f4ca2dc19ed39/core/fxge/cfx_fontmapper.cpp
[modify] https://crrev.com/979e916fde750e47f262c59dc75f4ca2dc19ed39/core/fxge/android/cfx_androidfontinfo.cpp
[modify] https://crrev.com/979e916fde750e47f262c59dc75f4ca2dc19ed39/core/fpdfapi/font/cpdf_cidfont.cpp
[modify] https://crrev.com/979e916fde750e47f262c59dc75f4ca2dc19ed39/core/fxge/cfx_folderfontinfo.h
[modify] https://crrev.com/979e916fde750e47f262c59dc75f4ca2dc19ed39/fpdfsdk/fpdf_sysfontinfo.cpp
[modify] https://crrev.com/979e916fde750e47f262c59dc75f4ca2dc19ed39/core/fxge/android/cfx_androidfontinfo.h
[modify] https://crrev.com/979e916fde750e47f262c59dc75f4ca2dc19ed39/core/fxge/cfx_substfont.cpp

Comment 7 by npm@chromium.org, Nov 9 2017

Status: Fixed (was: Assigned)
Looks fixed to me in Canary. Test pending
marcore: Did we ever get authorization from the customer, per comment 5?
@thestig no sorry, as far as I can understand using google translate from Japanese, Tier1 never asked :-(
so we can't use the file.

OK. I'll try to handcraft a test case then.

Sign in to add a comment