Update Wasm demo to 3ae6718
1 file changed
tree: bb4bb7e13fa62974bf62a6cd174997886f127809
  1. README.md
  2. a301fc0cd72ef20358f9.module.wasm
  3. bootstrap.js
  4. build-info.json
  5. index.html
  6. index_js.bootstrap.js

Textwrap WebAssembly Demo

An example showing how Textwrap can be used to wrap text in a HTML canvas. Both monospace and proportional fonts can be used since we use the browser to measure the pixel width of each word as it is rendered to the canvas.


  • Live demo: mgeisler.github.io/textwrap/. Here you can try the demo. It is automatically deployed on every merge to the master branch.

  • Source code: examples/wasm/. This is the Rust code which make up the demo. You will also find some JavaScript and HTML glue code.

  • GitHub Action: build.yml. This is the script which compiles and deploys the code. We use wasm-pack to easily compile Textwrap and its dependencies to Wasm.

  • Deployment branch: gh-pages. The compiled Wasm code is pushed to this branch. The branch might be squashed from time to time if it grows too big.