I abondoned this project but this was the plan.
This library aims to provide real-time MSDF font rendering using WebGPU, with on-the-fly MSDF generation from .ttf font
executed in WebAssembly scripts running in multiple WebWorkers.
The main thread orchestrates the workers, dispatching glyphs for MSDF computation, updating a shared texture atlas and metadata, and persisting both in IndexedDB for efficient caching and session recovery.
-
Main Thread
- Orchestrates workers.
- Packs glyphs into a texture atlas (using skyline/bin packing).
- Updates WebGPU texture and glyph metadata.
- Persists atlas and metadata into IndexedDB.
-
WebWorkers
- Run Rust-compiled WASM scripts.
- Compute MSDF bitmaps and glyph metrics for requested characters.
- Return results (bitmap + metrics) to the main thread.
-
IndexedDB
- Stores atlas data (raw buffer or PNG) and glyph metadata.
- Ensures fast reloading and avoids recomputation on subsequent sessions.
- Setup HTML CSS Layout
- Setup main script <-> webworker communication
- Setup WebGPU and Atlas display <- I gave up here
- Implement MSDF generation wasm script
- Implement MSDF webGPU rendering
- Implement IndexedDB persistance logic and lifecycle
IDKY Licence - I don't know yet, license