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

Out of memory error trying to convert Arial Unicode MS #14

Closed
1 task done
ChrisLoer opened this issue Dec 16, 2022 · 3 comments · Fixed by #15
Closed
1 task done

Out of memory error trying to convert Arial Unicode MS #14

ChrisLoer opened this issue Dec 16, 2022 · 3 comments · Fixed by #15

Comments

@ChrisLoer
Copy link
Collaborator

How to reproduce

I ran into this trying to make a font stack with Arial Unicode MS as a fallback using the demo site (https://maplibre.org/font-maker/). The error in the console is:

sdfglyph.js:1646 Cannot enlarge memory arrays to size 28626944 bytes (OOM). Either (1) compile with  -s INITIAL_MEMORY=X  with X higher than the current value 16777216, (2) compile with  -s ALLOW_MEMORY_GROWTH=1  which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with  -s ABORTING_MALLOC=0 

I think just adding -s ALLOW_MEMORY_GROWTH=1 to build_wasm.sh should be an easy fix.

I ended up just running font-maker from the command line to make the font stack, which seems to have worked without a hitch.

Awesome tool, by the way! It made me very happy to find this.

Attachments

  • Include the font file (.ttf or .otf) you are trying to convert.

Arial Unicode.ttf.zip

@bdon
Copy link
Collaborator

bdon commented Dec 16, 2022

Added that line in #15. Thanks for testing!

It does get rid of the error with the Arial Unicode font but the WASM version is really slow compared to the command line (which still takes a long time rendering most of the BMP with one thread).

This is related to some potential tasks that came up in maplibre/maplibre#154 for building a reproducible fallback based on Noto. I'll open a separate issue for that.

@bdon
Copy link
Collaborator

bdon commented Dec 16, 2022

#16

@ChrisLoer
Copy link
Collaborator Author

Thank you!

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 a pull request may close this issue.

2 participants