pdf-lib
pdf-lib copied to clipboard
Inconsistent line height when rendering multiline text inside form with custom font
Line height seems to be out of place, it doesn't really matter which custom font to use - happens to all of them. Maybe something is wrong here with rendering textLines, I'm not really sure.
Also, this was the only was to embed default form font:
const font = await pdfDoc.embedFont(CUSTOM_FONT);
const form = pdfDoc.getForm();
form.defaultFontCache = Cache.populatedBy(() => font);
Otherwise it was rewritten by Helvetica.
Here's an example of options list:
| Standard Font - Helvetica | Custom Font - San Francisco | Custom Font - Open Sans |
|---|---|---|
![]() |
![]() |
![]() |
I could've used Helvetica of course, but it doesn't support cyrillic characters unfortunately.
Hello @chislin! I'll need more information to investigate this further. Please consider filling out the new bug report form and we can go from there.


