harfbuzzjs
Providing HarfBuzz shaping
library for client/server side JavaScript projects.
See the demo here.
Building
- Install emscripten, git, cmake, nodejs, ninja and Google Closure
and make sure emcmake (emscripten related) is on your path
- ./build.sh
Not able to install all these in order to build .wasm
? Download
the pack from releases tab
of the project.
Usage and testing
Browser
(cd example && node server.js)
- Open the link on browser
Node.js
node examples/hbjs.example.node.js
Even the fact we provide a tiny wrapper around the main functionalities of
harfbuzz, it's easy to use other parts using module._hb*
functions,
see example/nohbjs.js to see how, but you may a custom build.
Can be added with npm i harfbuzzjs
or yarn add harfbuzzjs
, see the examples for
how to use it.
The wapm's .wasm
file is built on /wapm
directory of this project, run ./build.sh of
that folder to get .wasm
a full version of harfbuzz for wapm, currently released
here.
Need more of the library?
File a bug and mention your usecase.
You can also add the symbols you like to CMakeLists.txt and compile the pack yourself.
Another option also is to use .wasm
and .js
available at /wapm
folder of the release which is the full version but doesn't have an optimal size.
Stability?
We are considering a switch to WASI at least for wapm releases so consider it unstable yet usable for now.
Use the library in a bigger emscripten project?
See harfbuzz port inside emscripten
and emscripten-ports/HarfBuzz, basically all you need is to use
-s USE_HARFBUZZ=1
in your build.