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

[Feature] I want specific fonts that don't make the file large #1860

Open
1 task done
black-black-cat opened this issue Apr 11, 2024 · 0 comments
Open
1 task done
Assignees
Labels
enhancement New feature or request needs triage Issues that need to be triaged v4 Issues related to the latest version

Comments

@black-black-cat
Copy link

black-black-cat commented Apr 11, 2024

Is there an existing issue for this feature?

  • Yes, I have searched the existing issues and it doesn't exist.

Feature Description

Hi there,

I'm encountering a significant file size increase when using the Noto Sans SC font in generated PDFs. My files are jumping from around 600KB to 6MB, which is quite a leap.

I understand that some fonts can contribute to file size, and I'm curious if there are any potential solutions or workarounds to mitigate this with those large size file font like Noto Sans SC.

Does referring to this answer this answer, https://github.com/Hopding/pdf-lib/issues/207#issuecomment-537210471https://github.com/Hopding/pdf-lib/issues/207#issuecomment-537210471, help to solve the problem?

const ubuntuBytes = ...
const ubuntuFont = await pdfDoc.embedFont(ubuntuBytes, { subset: true })

PS.

I just read the doc about the exporting font.

There are other downsides to PDFs, such as font compatibility. However, Reactive Resume addresses this issue by embedding the font you choose in the app into the PDF. This may increase the file size slightly, but guarantees that your resume will display correctly regardless of the PDF reader used by the viewer.

@black-black-cat black-black-cat added enhancement New feature or request needs triage Issues that need to be triaged v4 Issues related to the latest version labels Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage Issues that need to be triaged v4 Issues related to the latest version
Projects
None yet
Development

No branches or pull requests

2 participants