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

Use pf-text with wasm #519

Open
AaronPorts opened this issue Aug 18, 2022 · 4 comments
Open

Use pf-text with wasm #519

AaronPorts opened this issue Aug 18, 2022 · 4 comments

Comments

@AaronPorts
Copy link

Is it possible to use features = ["pf-text"] with wasm? I have the next error during compilation:

warning: In file included from harfbuzz/src/harfbuzz.cc:1:
warning: In file included from harfbuzz/src/hb-aat-layout.cc:28:
warning: harfbuzz/src/hb.hh:178:10: fatal error: 'math.h' file not found
warning: #include <math.h>
warning:          ^~~~~~~~
warning: 1 error generated.

error: failed to run custom build command for `harfbuzz-sys v0.3.4`
@AaronPorts
Copy link
Author

Ok, it looks like the rust-harfbuzz dependency includes harfbuzz, which can be transpiled using wasm32-unknown-emscripten target, but I didn't manage to get it to work with wasm32-unknown-unknown. Maybe harfbuzz should be replaced with some rust port (like rustybuzz)?

@s3bk
Copy link
Collaborator

s3bk commented Aug 19, 2022

It is not possible.

I wrote a text render that works with pathfinder. It works on most latin an needs more testing for arabic and non-english scripts.
The code lives here: https://github.com/s3bk/svg/blob/master/text/src/lib.rs

@AaronPorts
Copy link
Author

@s3bk could you describe a little why it is not possible cause i am totally new in pathfinder and rust in general.

@s3bk
Copy link
Collaborator

s3bk commented Aug 20, 2022 via email

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