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

Add support for loadFont #4

Open
aardvarkk opened this issue Jan 30, 2023 · 2 comments
Open

Add support for loadFont #4

aardvarkk opened this issue Jan 30, 2023 · 2 comments

Comments

@aardvarkk
Copy link

Sorry if I'm missing something, but it's my understanding that loadFont is not part of the jimp-native library. I've noticed that bitmap font loading is very slow in jimp, and it looks like even if you try to run a bunch of font loading concurrently, they all get stuck in a queue anyway and the situation doesn't improve.

I think we'd see huge gains by implementing the font loading natively (and in parallel!) and this would eliminate a huge bottleneck in terms of speed.

@aardvarkk
Copy link
Author

Further profiling indicates loadFont isn't as slow as I initially thought, so please feel free to close if this issue is irrelevant or not in the plan.

@sjoerd108
Copy link
Member

I usually keep fonts around in memory and reuse them, if you have a lot of fonts that may not work though. The main bottleneck would come from reading and parsing the bitmaps themselves. I'm planning to overhaul this library so that parsing of image formats themselves are handled in C++ land, that would probably resolve the issue you're having.

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

2 participants