Skip to content

Providing HarfBuzz shaping library for client/server side JavaScript projects

License

Notifications You must be signed in to change notification settings

propellerfactory/harfbuzzjs

 
 

Repository files navigation

harfbuzzjs

Providing HarfBuzz shaping library for client/server side JavaScript projects.

See the demo here.

Building

  1. Install clang, lld and git
  2. ./build.sh

Download

Download the pack from releases tab of the project, or just download the demo page (the demo source is in gh-pages branch).

Usage and testing

Browser

  1. npx pad.js
  2. Open http://127.0.0.1/examples/hbjs.example.html or http://127.0.0.1/examples/nohbjs.html

Node.js

  1. (cd examples && node 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 see example/nohbjs.js to see how, but you may need a custom build.

Can be added with npm i harfbuzzjs or yarn add harfbuzzjs, see the examples for how to use it.

Need more of the library?

File a bug and mention your usecase.

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.

binaryen

Optionally you can install binaryen and use wasm-opt like:

wasm-opt -Oz hb.wasm -o hb.wasm

binaryen also provides wasm-dis which can be used for,

wasm-dis hb.wasm | grep export
wasm-dis hb.wasm | grep import

with that you can check if the built wasm file only exports things you need and doesn't need to import anything, as usual with wasm files built here.

About

Providing HarfBuzz shaping library for client/server side JavaScript projects

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 37.4%
  • C++ 36.8%
  • Shell 7.1%
  • TypeScript 7.0%
  • JavaScript 6.5%
  • HTML 5.2%