Browse Source

Use font's default width even when 0.

Bug 1392647 has a PDF where the default width of the font
is 0. It draws some charcodes that don't have glyphs, but
we were wrongly using the 1000 default width for these
charcodes causing some text to be overlapping.
Brendan Dahl 8 years ago
parent
commit
10ba292b46
  1. 2
      src/core/evaluator.js
  2. 1
      test/pdfs/.gitignore
  3. BIN
      test/pdfs/bug1392647.pdf
  4. 7
      test/test_manifest.json

2
src/core/evaluator.js

@ -2083,7 +2083,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() { @@ -2083,7 +2083,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
var defaultVMetrics;
var i, ii, j, jj, start, code, widths;
if (properties.composite) {
defaultWidth = dict.get('DW') || 1000;
defaultWidth = dict.has('DW') ? dict.get('DW') : 1000;
widths = dict.get('W');
if (widths) {

1
test/pdfs/.gitignore vendored

@ -145,6 +145,7 @@ @@ -145,6 +145,7 @@
!pr6531_2.pdf
!pr7352.pdf
!bug900822.pdf
!bug1392647.pdf
!issue918.pdf
!issue1905.pdf
!issue2833.pdf

BIN
test/pdfs/bug1392647.pdf

Binary file not shown.

7
test/test_manifest.json

@ -867,6 +867,13 @@ @@ -867,6 +867,13 @@
"link": false,
"type": "eq"
},
{ "id": "bug1392647",
"file": "pdfs/bug1392647.pdf",
"md5": "9770ea476630ca7d560b7c39430f8850",
"rounds": 1,
"link": false,
"type": "eq"
},
{ "id": "hudsonsurvey",
"file": "pdfs/hudsonsurvey.pdf",
"md5": "bf0e6576a7b6c2fe7485bce1b78e006f",

Loading…
Cancel
Save