| 1 | module sfons |
| 2 | |
| 3 | import fontstash |
| 4 | import sokol.memory |
| 5 | |
| 6 | @[typedef] |
| 7 | pub struct C.sfons_allocator_t { |
| 8 | pub: |
| 9 | alloc_fn memory.FnAllocatorAlloc = unsafe { nil } |
| 10 | free_fn memory.FnAllocatorFree = unsafe { nil } |
| 11 | user_data voidptr |
| 12 | } |
| 13 | |
| 14 | @[typedef] |
| 15 | pub struct C.sfons_desc_t { |
| 16 | pub: |
| 17 | width int // initial width of font atlas texture (default: 512, must be power of 2) |
| 18 | height int // initial height of font atlas texture (default: 512, must be power of 2) |
| 19 | allocator C.sfons_allocator_t // optional memory allocation overrides |
| 20 | } |
| 21 | |
| 22 | fn C.sfons_create(const_desc &C.sfons_desc_t) &fontstash.Context |
| 23 | fn C.sfons_destroy(ctx &fontstash.Context) |
| 24 | fn C.sfons_flush(ctx &fontstash.Context) |
| 25 | |
| 26 | fn C.sfons_rgba(r u8, g u8, b u8, a u8) u32 |
| 27 | |