1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08: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

@ -81,7 +81,7 @@ const SegoeuiBoldFactors = [
1.02511, 0.99298, 1.07237, 0.96752, 0.96752, 0.96752, 0.96752, 1.03424,
0.96752, 0.95801, 0.95801, 0.95801, 0.95801, 1.03424, 1.0106,
];
const SegoeuiBoldLineHeight = 1.33008;
const SegoeuiBoldMetrics = { lineHeight: 1.33008, lineGap: 0 };
// Factors to rescale LiberationSans-BoldItalic.ttf to have the same
// metrics as segoeuiz.ttf.
@ -152,7 +152,7 @@ const SegoeuiBoldItalicFactors = [
0.96752, 0.96752, 1.036, 0.96752, 0.97168, 0.97168, 0.97168, 0.97168, 1.036,
0.95134,
];
const SegoeuiBoldItalicLineHeight = 1.33008;
const SegoeuiBoldItalicMetrics = { lineHeight: 1.33008, lineGap: 0 };
// Factors to rescale LiberationSans-Italic.ttf to have the same
// metrics as segoeuii.ttf.
@ -223,7 +223,7 @@ const SegoeuiItalicFactors = [
0.96777, 0.96777, 0.96777, 0.96927, 0.96777, 0.9043, 0.9043, 0.9043, 0.9043,
0.96927, 0.95364,
];
const SegoeuiItalicLineHeight = 1.33008;
const SegoeuiItalicMetrics = { lineHeight: 1.33008, lineGap: 0 };
// Factors to rescale LiberationSans-Regular.ttf to have the same
// metrics as segoeui.ttf.
@ -294,15 +294,15 @@ const SegoeuiRegularFactors = [
1.00068, 0.91797, 0.99346, 0.96777, 0.96777, 0.96777, 0.96777, 0.96927,
0.96777, 0.9043, 0.9043, 0.9043, 0.9043, 0.96927, 1.00221,
];
const SegoeuiRegularLineHeight = 1.33008;
const SegoeuiRegularMetrics = { lineHeight: 1.33008, lineGap: 0 };
export {
SegoeuiBoldFactors,
SegoeuiBoldItalicFactors,
SegoeuiBoldItalicLineHeight,
SegoeuiBoldLineHeight,
SegoeuiBoldItalicMetrics,
SegoeuiBoldMetrics,
SegoeuiItalicFactors,
SegoeuiItalicLineHeight,
SegoeuiItalicMetrics,
SegoeuiRegularFactors,
SegoeuiRegularLineHeight,
SegoeuiRegularMetrics,
};