Skip to content

Commit 09a6789

Browse files
committed
Extend getNonStdFontMap for non-embedded version of the ItcSymbol font (issue 11532)
Despite its name, the fonts in ItcSymbol-family are "regular" fonts and not Symbol ones. However, given that the font name contains the word "Symbol" we ended up picking the wrong code-path in the `Font.fallbackToSystemFont`-method. *Please note:* While this patch ensures that the text becomes readable, by falling back a standard font, the rendering will obviously not be perfect. However, that's the PDF generators "fault" since non-embedded fonts cannot be guaranteed to render correctly in all environments.
1 parent 07e233d commit 09a6789

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

src/core/standard_fonts.js

+6
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ const getNonStdFontMap = getLookupTableFactory(function (t) {
129129
t["ComicSansMS-Bold"] = "Comic Sans MS-Bold";
130130
t["ComicSansMS-BoldItalic"] = "Comic Sans MS-BoldItalic";
131131
t["ComicSansMS-Italic"] = "Comic Sans MS-Italic";
132+
t["ItcSymbol-Bold"] = "Helvetica-Bold";
133+
t["ItcSymbol-BoldItalic"] = "Helvetica-BoldOblique";
134+
t["ItcSymbol-Book"] = "Helvetica";
135+
t["ItcSymbol-BookItalic"] = "Helvetica-Oblique";
136+
t["ItcSymbol-Medium"] = "Helvetica";
137+
t["ItcSymbol-MediumItalic"] = "Helvetica-Oblique";
132138
t.LucidaConsole = "Courier";
133139
t["LucidaConsole-Bold"] = "Courier-Bold";
134140
t["LucidaConsole-BoldItalic"] = "Courier-BoldOblique";

test/pdfs/issue11532.pdf.link

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://github.com/mozilla/pdf.js/files/7086733/ar99.pdf

test/test_manifest.json

+9
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@
7676
"link": false,
7777
"type": "eq"
7878
},
79+
{ "id": "issue11532",
80+
"file": "pdfs/issue11532.pdf",
81+
"md5": "9216481d259ae2b8d747236e745cbc80",
82+
"rounds": 1,
83+
"link": true,
84+
"firstPage": 2,
85+
"lastPage": 2,
86+
"type": "eq"
87+
},
7988
{ "id": "issue11549",
8089
"file": "pdfs/issue11549_reduced.pdf",
8190
"md5": "a1ea636f413e02e10dbdf379ab4a99ae",

0 commit comments

Comments
 (0)