Extend getNonStdFontMap for non-embedded versions 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.
This commit is contained in:
Jonas Jenwald 2021-08-31 22:37:09 +02:00
parent 07e233d08b
commit ba9f004097
3 changed files with 16 additions and 0 deletions

View File

@ -129,6 +129,12 @@ const getNonStdFontMap = getLookupTableFactory(function (t) {
t["ComicSansMS-Bold"] = "Comic Sans MS-Bold";
t["ComicSansMS-BoldItalic"] = "Comic Sans MS-BoldItalic";
t["ComicSansMS-Italic"] = "Comic Sans MS-Italic";
t["ItcSymbol-Bold"] = "Helvetica-Bold";
t["ItcSymbol-BoldItalic"] = "Helvetica-BoldOblique";
t["ItcSymbol-Book"] = "Helvetica";
t["ItcSymbol-BookItalic"] = "Helvetica-Oblique";
t["ItcSymbol-Medium"] = "Helvetica";
t["ItcSymbol-MediumItalic"] = "Helvetica-Oblique";
t.LucidaConsole = "Courier";
t["LucidaConsole-Bold"] = "Courier-Bold";
t["LucidaConsole-BoldItalic"] = "Courier-BoldOblique";

View File

@ -0,0 +1 @@
https://github.com/mozilla/pdf.js/files/7086733/ar99.pdf

View File

@ -76,6 +76,15 @@
"link": false,
"type": "eq"
},
{ "id": "issue11532",
"file": "pdfs/issue11532.pdf",
"md5": "9216481d259ae2b8d747236e745cbc80",
"rounds": 1,
"link": true,
"firstPage": 2,
"lastPage": 2,
"type": "eq"
},
{ "id": "issue11549",
"file": "pdfs/issue11549_reduced.pdf",
"md5": "a1ea636f413e02e10dbdf379ab4a99ae",