///| Wasm font backend: the component has no C rasteriser, so glyphs come from the host's /// `chandra:host/font` import (the host draws them from the TTF files it loads). ///| Load a TTF file into `slot`. fn b_load(slot : Int, path : String) -> Bool { @hostfont.load(slot.reinterpret_as_uint(), path) } ///| Rasterise one glyph. fn b_glyph(slot : Int, cp : Int, size : Int) -> RawGlyph { let g = @hostfont.rasterise( slot.reinterpret_as_uint(), cp.reinterpret_as_uint(), size.reinterpret_as_uint(), ) { w: g.width, h: g.height, xoff: g.xoff, yoff: g.yoff, advance: g.advance, coverage: Bytes::from_fixedarray(g.coverage), } }