1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Merge pull request #11528 from janpe2/type1-nonemb-notdef

Hide .notdef glyphs in non-embedded Type1 fonts and don't ignore Widths
This commit is contained in:
Brendan Dahl 2020-02-06 13:30:07 -08:00 committed by GitHub
commit 09a6e17d22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 125 additions and 8 deletions

View file

@ -3184,6 +3184,16 @@ var Font = (function FontClosure() {
// back to the char code.
fontCharCode = this.toFontChar[charcode] || charcode;
if (this.missingFile) {
const glyphName =
this.differences[charcode] || this.defaultEncoding[charcode];
if (
(glyphName === ".notdef" || glyphName === "") &&
this.type === "Type1"
) {
// .notdef glyphs should be invisible in non-embedded Type1 fonts, so
// replace them with spaces.
fontCharCode = 0x20;
}
fontCharCode = mapSpecialUnicodeValues(fontCharCode);
}