-
Notifications
You must be signed in to change notification settings - Fork 61
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
WebAssembly support #153
Comments
And it'd be nice if we didn't have to specify |
This supports building harfbuzz-sys for WebAssembly using: --target wasm32-unknown-unknown --features=build-native-harfbuzz Building with emscripten may or may not work yet. This is progress on issue servo#153.
Hello. I know that there is only preliminary build support for webassembly. However, I wanted to notify you that for me, building for webassembly results in a multiple definition linker error on master:
The commit 0d6d0cb from #155 works fine. I ran a
I would love to contribute to fixing this, however I am by no means an expert when it comes to C builld systems. If I can help in any way, please let me know! Thank you :) |
Is it possible to compile to wasm32-unknown-unknown |
What is the status of building for Rust projects for WebAssembly that would like to use this dependency (and FreeType)? |
Right now, Pathfinder can build in wasm and works, but text is disabled because HB doesn't build. |
In case you haven't seen it, @RazrFalcon is incrementally porting harfbuzz to pure Rust: https://github.com/RazrFalcon/rustybuzz, which will allow it to be compiled to wasm. |
@dabreegster I hope it will take less than half a year to finish it... |
HarfBuzz compiles to WASM, several projects do this already (not combined with rust, thought), see https://github.com/harfbuzz/harfbuzzjs |
Has anybody wired up Edit: Oops, that's what this bug is for. :P |
harfbuzzjs +1 |
It's also worth mentioning now that @RazrFalcon's RustyBuzz port is now done. I realize @pcwalton is no longer employed to work on this project but I wonder if a community member may be able to replace HarfBuzz with RustyBuzz. |
I suspect it would be better for projects that depend on this crate to migrate to RustyHarfbuzz instead. |
Isn't this mostly useful for rasterization of the glyphs once they are shaped? Is that still possible after feeding them through RustyBuzz if it's compiled without C dependencies? Or is there a better non-C alternative for the glyph rasterization step after shaping? |
Are there things that rust-harfbuzz does that RustyHarfbuzz does not? |
RustyBuzz has a subset of the features from HarfBuzz, but I believe those mostly don't relate to shaping. Possibly Pathfinder doesn't use those extra features? |
Is there any solution to use harfbuzz with wasm32-unknown-unknown target or replace it with rust port? |
RustyBuzz is likely to suit your needs. We're using it successfully in Graphite at https://editor.graphite.rs |
I'm partially able to get a hacked up local build with WebAssembly locally as something that I'd been playing with, but I saw that @pcwalton is also working on this ... so I'll share what I know here:
I was doing:
The
build.rs
needs to have it use thecmake
code path, so I had just done this for now:Then, I had modified the bundled
harfbuzz-sys/harfbuzz/CMakeLists.txt
to skip theAPPLE
section so that it doesn't try to build CoreText support or link against ApplicationServices.The section here is:
Once I did that, I can get a working build and run the tests manually:
This looks like I need to tell
emcc
to have-s DISABLE_EXCEPTION_CATCHING=0
... but I hadn't done that yet.The text was updated successfully, but these errors were encountered: