Issue 625 in pdfium: Bad font substitution on Mac

77 views
Skip to first unread message

thes… via monorail

unread,
Oct 21, 2016, 7:41:50 PM10/21/16
to pdfiu...@googlegroups.com
Status: Accepted
Owner: ----
CC: n...@chromium.org
Labels: Type-Defect Priority-Medium

New issue 625 by the...@chromium.org: Bad font substitution on Mac
https://bugs.chromium.org/p/pdfium/issues/detail?id=625

What steps will reproduce the problem?
1. Take the PDF from https://goto.google.com/pdfium_bug_624 - the PDF has no embedded fonts.
2. render it with pdfium_test on Mac.

What is the expected output? What do you see instead?

Expected: Font substitution results in readable text
Actual: Font substitution results in "tofu" blocks

Works mostly ok on Linux, but there are still some artifacts. Rendering on Mac with Skia produces similar results to Linux.

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

thes… via monorail

unread,
Oct 21, 2016, 7:45:06 PM10/21/16
to pdfiu...@googlegroups.com

Comment #1 on issue 625 by the...@chromium.org: Bad font substitution on Mac
https://bugs.chromium.org/p/pdfium/issues/detail?id=625#c1

Mac Preview.app behaves similiarly to Mac pdfium_test + Skia.

nicol… via monorail

unread,
Oct 23, 2016, 7:14:12 PM10/23/16
to pdfiu...@googlegroups.com

Comment #2 on issue 625 by nico...@google.com: Bad font substitution on Mac
https://bugs.chromium.org/p/pdfium/issues/detail?id=625#c2

Read in Adobe Reader, in Linux, Mac OS, Windows 10, it all works fine.

Tested in Chrome, in Linux, Windows 10, there are some artifacts, especially the special character.

Tested in Safari, Firefox on Mac, they have the same artifacts as display in Chrome in Linux and Windows, but it is in readable text.

Tested in Chrome, Incognito, Canary on Mac, none of them are displayed in readable text.

n… via monorail

unread,
Oct 24, 2016, 4:12:55 PM10/24/16
to pdfiu...@googlegroups.com
Updates:
Cc: -n...@chromium.org the...@chromium.org
Owner: n...@chromium.org

Comment #3 on issue 625 by n...@chromium.org: Bad font substitution on Mac
https://bugs.chromium.org/p/pdfium/issues/detail?id=625#c3

The problem is loading stuff from ArialUnicodeMS, which is the font we're using as substitute for the most part. We are trying to set ExtGID using some Mac methods here https://cs.chromium.org/chromium/src/third_party/pdfium/core/fpdfapi/font/cpdf_type1font.cpp?sq=package:chromium&l=326

But it's not recognizing the glyphs, so we render tofu blocks. A solution would be to use the m_GlyphIndex instead of the m_ExtGID whenever the latter is 0 - this makes the rendering look like Mac.Preview. But I'm not very familiar with this and not sure if that is a reasonable solution. What do you think Lei?

thes… via monorail

unread,
Oct 24, 2016, 9:26:19 PM10/24/16
to pdfiu...@googlegroups.com

Comment #4 on issue 625 by the...@chromium.org: Bad font substitution on Mac
https://bugs.chromium.org/p/pdfium/issues/detail?id=625#c4

I'm not that familiar either. |m_ExtGID| should contain glyph indices, right? Does a value of 0 represent "invalid" in this context?

n… via monorail

unread,
Oct 25, 2016, 10:56:36 AM10/25/16
to pdfiu...@googlegroups.com
Updates:
Status: Started

Comment #5 on issue 625 by n...@chromium.org: Bad font substitution on Mac
https://bugs.chromium.org/p/pdfium/issues/detail?id=625#c5

Yes

bugdro… via monorail

unread,
Oct 25, 2016, 2:37:57 PM10/25/16
to pdfiu...@googlegroups.com

Comment #6 on issue 625 by bugd...@chromium.org: Bad font substitution on Mac
https://bugs.chromium.org/p/pdfium/issues/detail?id=625#c6

The following revision refers to this bug:
https://pdfium.googlesource.com/pdfium.git/+/4ee6139e8cfecab9e181115894b26131ad6de09a

commit 4ee6139e8cfecab9e181115894b26131ad6de09a
Author: npm
Date: Tue Oct 25 18:37:02 2016

Use m_GlyphIndex as backup for m_ExtGID on Mac

When CGFontGetGlyphWithGlyphName returns 0, it means the glyph name
was not recognized. In this case, try using the glyph index to load the
glyph.

BUG=pdfium:625

Review-Url: https://codereview.chromium.org/2445933002

[modify] https://crrev.com/4ee6139e8cfecab9e181115894b26131ad6de09a/core/fxge/apple/fx_apple_platform.cpp

n… via monorail

unread,
Oct 26, 2016, 2:02:16 PM10/26/16
to pdfiu...@googlegroups.com
Updates:
Status: Fixed

Comment #7 on issue 625 by n...@chromium.org: Bad font substitution on Mac
https://bugs.chromium.org/p/pdfium/issues/detail?id=625#c7

(No comment was entered for this change.)

nicol… via monorail

unread,
Oct 26, 2016, 10:36:12 PM10/26/16
to pdfiu...@googlegroups.com

Comment #8 on issue 625 by nico...@google.com: Bad font substitution on Mac
https://bugs.chromium.org/p/pdfium/issues/detail?id=625#c8

Do we need to do anything in client's end? I made sure my chrome is up to date, tried in Chrome and Incognito windows, both of them still have the same issue, after it marks as fixed. Could you please advise?

thes… via monorail

unread,
Oct 26, 2016, 10:50:54 PM10/26/16
to pdfiu...@googlegroups.com

Comment #9 on issue 625 by the...@chromium.org: Bad font substitution on Mac
https://bugs.chromium.org/p/pdfium/issues/detail?id=625#c9

At the current rate, the fix will make it into Chrome 56.
Reply all
Reply to author
Forward
0 new messages