Update Wasm demo to 6397036
5 files changed
tree: 65fc043b3c4877355f2e022732115c305c5d560c
  1. bootstrap.js
  2. bootstrap.js.map
  3. build-info.json
  4. c4492eea8511646bffab.module.wasm
  5. index.html
  6. index_js.bootstrap.js
  7. index_js.bootstrap.js.map
  8. README.md
README.md

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.

Links

  • 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.