Skip to content

Commit

Permalink
Merge pull request mozilla#18306 from calixteman/bug1903731
Browse files Browse the repository at this point in the history
Always use DW if it's a number for the font default width (bug 1903731)
  • Loading branch information
calixteman authored Jun 20, 2024
2 parents 1cf19e9 + 8c9a665 commit a081dd2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/evaluator.js
Original file line number Diff line number Diff line change
Expand Up @@ -3905,7 +3905,7 @@ class PartialEvaluator {
let defaultVMetrics;
if (properties.composite) {
const dw = dict.get("DW");
defaultWidth = Number.isInteger(dw) ? dw : 1000;
defaultWidth = typeof dw === "number" ? Math.ceil(dw) : 1000;

const widths = dict.get("W");
if (Array.isArray(widths)) {
Expand Down
2 changes: 2 additions & 0 deletions test/pdfs/bug1903731.pdf.link
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://bugzilla.mozilla.org/attachment.cgi?id=9408642

8 changes: 8 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10097,5 +10097,13 @@
"md5": "73922be020083d54747af18a4d5e0768",
"rounds": 1,
"type": "eq"
},
{
"id": "bug1903731",
"file": "pdfs/bug1903731.pdf",
"md5": "c90d1b03a62d0221e5f5609e3db16a38",
"rounds": 1,
"link": true,
"type": "eq"
}
]

0 comments on commit a081dd2

Please sign in to comment.