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.
This commit is contained in:
Brendan Dahl 2017-09-20 11:37:56 -07:00
parent 9c2e9dae26
commit 10ba292b46
4 changed files with 9 additions and 1 deletions

View File

@ -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) {

View File

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

BIN
test/pdfs/bug1392647.pdf Normal file

Binary file not shown.

View File

@ -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",