Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use CMap in Type0 fonts when CFF is not a CID font #10683

Merged
merged 1 commit into from
Mar 27, 2019

Conversation

janpe2
Copy link
Contributor

@janpe2 janpe2 commented Mar 26, 2019

Fixes #9534
in which the PDF uses composite Type0 fonts and the embedded CFF data is not in CID font format. The problems are caused by the Encoding entry whose value is an embedded CMap stream. The existing implementation ignores the CMap, so wrong glyphs are rendered.

Most PDFs like this use /Encoding /Identity-H instead. They have no problems and their rendering is not affected by this PR.

@timvandermeij
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_test from @timvandermeij received. Current queue size: 2

Live output at: http://54.67.70.0:8877/c5fda57454cae19/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @timvandermeij received. Current queue size: 2

Live output at: http://54.215.176.217:8877/23a24e24a4df85b/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/c5fda57454cae19/output.txt

Total script time: 18.17 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.215.176.217:8877/23a24e24a4df85b/output.txt

Total script time: 25.44 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://54.215.176.217:8877/23a24e24a4df85b/reftest-analyzer.html#web=eq.log

@janpe2
Copy link
Contributor Author

janpe2 commented Mar 27, 2019

Actually the PDF isn't broken. The spec mentions that CFF data can be used like this. Because the CFF doesn't support CIDs, glyph indexes are used as CID values.

@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://54.67.70.0:8877/8c29a31e08c98cb/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/8c29a31e08c98cb/output.txt

Total script time: 1.88 mins

Published

@timvandermeij timvandermeij merged commit f9c5811 into mozilla:master Mar 27, 2019
@timvandermeij
Copy link
Contributor

Nice find, thanks!

@timvandermeij
Copy link
Contributor

/botio makeref

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_makeref from @timvandermeij received. Current queue size: 0

Live output at: http://54.67.70.0:8877/3eb43a8fb7240a7/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_makeref from @timvandermeij received. Current queue size: 2

Live output at: http://54.215.176.217:8877/d0a9a3615312de1/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/3eb43a8fb7240a7/output.txt

Total script time: 16.64 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/d0a9a3615312de1/output.txt

Total script time: 22.95 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

@janpe2 janpe2 deleted the type0-noncid-cmap branch March 10, 2020 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants