pdf-lib icon indicating copy to clipboard operation
pdf-lib copied to clipboard

Inconsistent line height when rendering multiline text inside form with custom font

Open chislin opened this issue 5 years ago • 1 comments

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
Helvetica San Francisco Open Sans

I could've used Helvetica of course, but it doesn't support cyrillic characters unfortunately.

chislin avatar Aug 03 '21 15:08 chislin

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.

Hopding avatar Sep 22 '21 22:09 Hopding