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

preload font files into memory to avoid frequent IO. #366

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

iola1999
Copy link

@iola1999 iola1999 commented Nov 21, 2024

close #367 .

I believe this might be related to how the underlying dependencies (resvg/fontdb) handle font loading, rather than an issue with resvg-js itself.

This PR adds a preloadFonts option to load font files into memory at initialization. While this doesn't address the root cause in the underlying libraries, it provides a practical workaround for resvg-js users experiencing performance issues with text-heavy SVGs.

@iola1999 iola1999 marked this pull request as ready for review November 21, 2024 19:38
@iola1999 iola1999 changed the title [WIP] preload font files into memory to avoid frequent IO. preload font files into memory to avoid frequent IO. Nov 21, 2024
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

Successfully merging this pull request may close these issues.

Performance issue: Frequent font file I/O operations when rendering SVG with text
1 participant