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

SVG: Don't render missing glyphs #8785

Merged
merged 1 commit into from
Aug 17, 2017

Conversation

Rob--W
Copy link
Member

@Rob--W Rob--W commented Aug 16, 2017

This bug is similar to the canvas bug of #6721, which was fixed by #7023

See commit description for more info and test cases.

New reduced test case introduced with this PR:

(I did not add an automated test because we don't have any ref test framework for SVG (e.g. painting SVG on a canvas, and then doing an image comparison, as done in #5863 - somehow that issue was closed without follow-up...).

The test case from #6721 can be used here too:

@Rob--W Rob--W added the 4-svg label Aug 16, 2017
This bug is similar to the canvas bug of mozilla#6721.
I found this bug when I tried to run pdf2svg on a SVG file, and the generated
SVG could not be viewed in Chrome due to a SVG/XML parsing error:
"PCDATA invalid Char value 3"

Reduced test case:
- https://github.com/mozilla/pdf.js/files/1229507/pcdatainvalidchar.pdf
- expected: "hardware performance"
- Actual SVG source: "hardware\x03performance"
  (where "\x03" is a non-printable character, and invalid XML).

In terms of rendering, this bug is similar to mozilla#6721, where an unexpected glyph
appeared in the canvas renderer. This was fixed by mozilla#7023, which skips over
missing glyphs. This commit follows a similar logic.

The test case from mozilla#6721 can be used here too:
- https://github.com/mozilla/pdf.js/files/52205/issue6721_reduced.pdf
  expected: "Issue   6721"
  actual (before this patch): "Issue ààà6721"
@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/d3673cdf35b4ecb/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

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

Total script time: 2.35 mins

Published

@timvandermeij
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://54.215.176.217:8877/76d0a9ffaa84bce/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

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

Total script time: 16.44 mins

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/76d0a9ffaa84bce/output.txt

Total script time: 29.30 mins

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

@timvandermeij timvandermeij merged commit 50e10fd into mozilla:master Aug 17, 2017
@timvandermeij
Copy link
Contributor

Thank you for fixing this!

movsb pushed a commit to movsb/pdf.js that referenced this pull request Jul 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants