Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance 5x Slower PDFKit Document creation and unresponsive for CJK custom WOFF fonts. #1469

Open
Saranya-Sivanandham opened this issue Oct 13, 2023 · 2 comments

Comments

@Saranya-Sivanandham
Copy link

Bug Report

Slow PDFKit Document creation and unresponsive, when WOFF type fonts are used.
No performance impact for the same font in TTF

Description of the problem

We are generating a text-only single-page PDF.
For languages Chinese, Hebrew & Japanese, we are making use of the below Google font in WOFF format downloaded from Google Webfonts helper.

Chinese - Noto Sans SC (1.5 MB) Download link Choose Historic support to get WOFF format.

Japanese / Hebrew - M PLUS 1p regular Download link Choose Historic support to get WOFF format.

For the above languages with the mentioned fonts, the pdf download takes around 8 seconds - 11 seconds for a single page.And it becomes unresponsive in Firefox. However, for other languages, it is way less ~ around 1 -2 seconds.

With TTF it works better without any issues

Note: Unable to upload woff font in GitHub. So shared the link from where I downloaded it.

Your environment

  • pdfkit version: 0.12.10
  • Node version: 18
  • Browser version (if applicable): Chrome Delay is seen but in Firefox it becomes unresponsive.
  • Operating System: Windows
@rohinthr
Copy link

rohinthr commented Nov 8, 2023

@Saranya-Sivanandham ,I face the similar issue while using WOFF format.Sometimes its throw error. Better to use TTF font. It will work fine.

@blikblum
Copy link
Member

Can you post sample code that shows the difference?

You can fork https://replit.com/@blikblum/minimal-pdfkit or post a complete node script here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants