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

XFA - Fix auto-sized fields (bug 1722030)

- In order to better compute text fields size, use line height with no gaps (and consequently guessed height for text are slightly better in general).
  - Fix default background color in fields.
This commit is contained in:
Calixte Denizet 2021-07-27 18:43:05 +02:00
parent 336a74a0e5
commit 76d882b560
14 changed files with 311 additions and 162 deletions

View file

@ -2550,7 +2550,8 @@ class Font {
this.lineGap = metricsOverride.lineGap / metricsOverride.unitsPerEm;
if (this.cssFontInfo && this.cssFontInfo.lineHeight) {
this.lineHeight = this.cssFontInfo.lineHeight;
this.lineHeight = this.cssFontInfo.metrics.lineHeight;
this.lineGap = this.cssFontInfo.metrics.lineGap;
} else {
this.lineHeight = this.ascent - this.descent + this.lineGap;
}