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

Annotation & XFA: Scale the font size in choicelist using zoom factor (bug 1715996)

- this is an accessibility issue which could be painful for some people with visual disabilities.
This commit is contained in:
Calixte Denizet 2021-08-04 14:42:24 +02:00
parent 52ef63f1fe
commit 71a100a4d0
4 changed files with 21 additions and 0 deletions

View file

@ -1293,6 +1293,10 @@ class ChoiceList extends XFAObject {
const style = toStyle(this, "border", "margin");
const ui = this[$getParent]();
const field = ui[$getParent]();
const fontSize = (field.font && field.font.size) || 10;
const optionStyle = {
fontSize: `calc(${fontSize}px * var(--zoom-factor))`,
};
const children = [];
if (field.items.children.length > 0) {
@ -1313,6 +1317,7 @@ class ChoiceList extends XFAObject {
name: "option",
attributes: {
value: values[i] || displayed[i],
style: optionStyle,
},
value: displayed[i],
};