[api-minor] Annotations - Adjust the font size in text field in considering the total width (bug 1721335)

- it aims to fix #14502 and bug 1721335;
 - Acrobat and Pdfium do the same;
 - it'll avoid to have truncated data when printed;
 - change the factor to compute font size in using field height: lineHeight = 1.35*fontSize
  - this is the value used by Acrobat.
 - in order to not have truncated strings on the bottom, add few basic metrics for standard fonts.
This commit is contained in:
Calixte Denizet 2022-01-27 22:51:30 +01:00
parent 8f6965b197
commit ae842e1c3a
8 changed files with 214 additions and 40 deletions

View file

@ -2010,8 +2010,10 @@ page 1 / 3`);
});
expect(styles[fontName]).toEqual({
fontFamily: "serif",
ascent: NaN,
descent: NaN,
// `useSystemFonts` has a different value in web environments
// and in Node.js.
ascent: isNodeJS ? NaN : 0.683,
descent: isNodeJS ? NaN : -0.217,
vertical: false,
});