mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
[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:
parent
8f6965b197
commit
ae842e1c3a
8 changed files with 214 additions and 40 deletions
|
@ -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,
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue