1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-28 23:28:16 +02:00

XFA - Fix font scale factors (bug 1720888)

- All the scale factors in for the substitution font were wrong because of different glyph positions between Liberation and the other ones:
    - regenerate all the factors
  - Text may have polish chars for example and in this case the glyph widths were wrong:
    - treat substitution font as a composite one
    - add a map glyphIndex to unicode for Liberation in order to generate width array for cid font
This commit is contained in:
Calixte Denizet 2021-07-28 18:30:22 +02:00
parent ac5c4b7fd0
commit 4a4591bd2c
17 changed files with 1614 additions and 1248 deletions

View file

@ -73,6 +73,8 @@ const $onChild = Symbol();
const $onChildCheck = Symbol();
const $onText = Symbol();
const $pushGlyphs = Symbol();
const $popPara = Symbol();
const $pushPara = Symbol();
const $removeChild = Symbol();
const $root = Symbol("root");
const $resolvePrototypes = Symbol();
@ -177,6 +179,16 @@ class XFAObject {
return false;
}
[$popPara]() {
if (this.para) {
this[$getTemplateRoot]()[$extra].paraStack.pop();
}
}
[$pushPara]() {
this[$getTemplateRoot]()[$extra].paraStack.push(this.para);
}
[$setId](ids) {
if (this.id && this[$namespaceId] === NamespaceIds.template.id) {
ids.set(this.id, this);
@ -1109,7 +1121,9 @@ export {
$onChild,
$onChildCheck,
$onText,
$popPara,
$pushGlyphs,
$pushPara,
$removeChild,
$resolvePrototypes,
$root,