mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Ignore named encoding for non-embedded symbol fonts (issue 16464)
The affected font is non-embedded ZapfDingbats, however the PDF document for some inexplicable reason specifies the encoding as "WinAnsiEncoding" (which is obviously wrong). To work-around this bug in the PDF generator, we'll simply ignore any explicitly specified named encoding for non-embedded symbol fonts.
This commit is contained in:
parent
a6f9505a39
commit
aeed6f2b67
3 changed files with 21 additions and 1 deletions
|
@ -3487,6 +3487,17 @@ class PartialEvaluator {
|
|||
}
|
||||
}
|
||||
|
||||
const nonEmbeddedFont = !properties.file || properties.isInternalFont;
|
||||
// Ignore an incorrectly specified named encoding for non-embedded
|
||||
// symbol fonts (fixes issue16464.pdf).
|
||||
if (
|
||||
baseEncodingName &&
|
||||
nonEmbeddedFont &&
|
||||
getSymbolsFonts()[properties.name]
|
||||
) {
|
||||
baseEncodingName = null;
|
||||
}
|
||||
|
||||
if (baseEncodingName) {
|
||||
properties.defaultEncoding = getEncoding(baseEncodingName);
|
||||
} else {
|
||||
|
@ -3503,7 +3514,7 @@ class PartialEvaluator {
|
|||
// Heuristic: we have to check if the font is a standard one also
|
||||
if (isSymbolicFont) {
|
||||
encoding = MacRomanEncoding;
|
||||
if (!properties.file || properties.isInternalFont) {
|
||||
if (nonEmbeddedFont) {
|
||||
if (/Symbol/i.test(properties.name)) {
|
||||
encoding = SymbolSetEncoding;
|
||||
} else if (/Dingbats|Wingdings/i.test(properties.name)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue