// Generated by `wit-bindgen` 0.63.0. DO NOT EDIT! ///| /// One rendered glyph: an 8-bit coverage bitmap `width` x `height`, whose top-left sits at /// (`xoff`, `yoff`) from the pen on the baseline (y grows downward), and the pen advance. pub(all) struct Glyph { width : Int; height : Int; xoff : Int; yoff : Int; advance : Int; coverage : FixedArray[Byte] } ///| /// Load the TTF file at `path` into `slot` (0..3). False when it can't be read or parsed. pub fn load(slot : UInt, path : String) -> Bool { let ptr = mbt_ffi_str2ptr(path) let result : Int = wasmImportLoad((slot).reinterpret_as_int(), ptr, path.length()); let ret = (result != 0) mbt_ffi_free(ptr) return ret } ///| pub fn rasterise(slot : UInt, codepoint : UInt, size : UInt) -> Glyph { let return_area = mbt_ffi_malloc(28) wasmImportRasterise((slot).reinterpret_as_int(), (codepoint).reinterpret_as_int(), (size).reinterpret_as_int(), return_area); let result = mbt_ffi_ptr2bytes(mbt_ffi_load32((return_area) + 20), mbt_ffi_load32((return_area) + 24)) let ret = Glyph::{width : mbt_ffi_load32((return_area) + 0), height : mbt_ffi_load32((return_area) + 4), xoff : mbt_ffi_load32((return_area) + 8), yoff : mbt_ffi_load32((return_area) + 12), advance : mbt_ffi_load32((return_area) + 16), coverage : result} mbt_ffi_free(return_area) return ret }