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

Fallback font for buttons must be ZapfDingbats.

Fix bug https://bugzilla.mozilla.org/show_bug.cgi?id=1669099.
This commit is contained in:
Calixte Denizet 2020-10-21 17:21:33 +02:00
parent 1eaf9c961b
commit 37c86b2daa
6 changed files with 109 additions and 5 deletions

View file

@ -26,6 +26,7 @@ import {
getModificationDate,
isString,
OPS,
shadow,
stringToPDFString,
unreachable,
Util,
@ -281,6 +282,8 @@ class Annotation {
rect: this.rectangle,
subtype: params.subtype,
};
this._fallbackFontDict = null;
}
/**
@ -576,6 +579,7 @@ class Annotation {
task,
resources,
operatorList: opList,
fallbackFontDict: this._fallbackFontDict,
})
.then(() => {
opList.addOp(OPS.endAnnotation, []);
@ -1873,6 +1877,7 @@ class ButtonWidgetAnnotation extends WidgetAnnotation {
if (this.uncheckedAppearance) {
this._streams.push(this.uncheckedAppearance);
}
this._fallbackFontDict = this.fallbackFontDict;
}
_processRadioButton(params) {
@ -1912,6 +1917,7 @@ class ButtonWidgetAnnotation extends WidgetAnnotation {
if (this.uncheckedAppearance) {
this._streams.push(this.uncheckedAppearance);
}
this._fallbackFontDict = this.fallbackFontDict;
}
_processPushButton(params) {
@ -1954,6 +1960,16 @@ class ButtonWidgetAnnotation extends WidgetAnnotation {
type,
};
}
get fallbackFontDict() {
const dict = new Dict();
dict.set("BaseFont", Name.get("ZapfDingbats"));
dict.set("Type", Name.get("FallbackType"));
dict.set("Subtype", Name.get("FallbackType"));
dict.set("Encoding", Name.get("ZapfDingbatsEncoding"));
return shadow(this, "fallbackFontDict", dict);
}
}
class ChoiceWidgetAnnotation extends WidgetAnnotation {