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

Always re-measure non-embedded ArialNarrow fonts (bug 1671312, PR 12725 follow-up) #12861

Merged
merged 1 commit into from
Jan 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/core/fonts.js
Original file line number Diff line number Diff line change
Expand Up @@ -1335,8 +1335,13 @@ var Font = (function FontClosure() {
// name ArialBlack for example will be replaced by Helvetica.
this.black = name.search(/Black/g) !== -1;

// Use 'name' instead of 'fontName' here because the original
// name ArialNarrow for example will be replaced by Helvetica.
const isNarrow = name.search(/Narrow/g) !== -1;

// if at least one width is present, remeasure all chars when exists
this.remeasure = !isStandardFont && Object.keys(this.widths).length > 0;
this.remeasure =
(!isStandardFont || isNarrow) && Object.keys(this.widths).length > 0;
if (
(isStandardFont || isMappedToStandardFont) &&
type === "CIDFontType2" &&
Expand Down
1 change: 1 addition & 0 deletions test/pdfs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@
!issue6889.pdf
!bug1001080.pdf
!bug1671312_reduced.pdf
!bug1671312_ArialNarrow.pdf
!issue6108.pdf
!issue6113.pdf
!openoffice.pdf
Expand Down
Binary file added test/pdfs/bug1671312_ArialNarrow.pdf
Binary file not shown.
6 changes: 6 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2301,6 +2301,12 @@
"rounds": 1,
"type": "eq"
},
{ "id": "bug1671312_ArialNarrow",
"file": "pdfs/bug1671312_ArialNarrow.pdf",
"md5": "f4f0a0d1dc9276bd6e3402165ecdc3d7",
"rounds": 1,
"type": "eq"
},
{ "id": "issue7020",
"file": "pdfs/issue7020.pdf",
"md5": "93b464e21c649e64ae92eeafe99fc31b",
Expand Down