const (
used_import = 1
)
#flag -lfreetype
fn create_internal(params &C.FONSparams) &C.FONScontext
Contructor and destructor.
fn delete_internal(s &C.FONScontext)
enum FonsAlign {
left = 1
center = 2
right = 4
top = 8
middle = 16
bottom = 32
baseline = 64
}
enum FonsErrorCode {
atlas_full = 1
scratch_full = 2
states_overflow = 3
states_underflow = 4
}
enum FonsFlags {
top_left = 1
bottom_left = 2
}
struct C.FONScontext {}
fn (s &C.FONScontext) add_fallback_font(base int, fallback int) int
fn (s &C.FONScontext) add_font_mem(name byteptr, data byteptr, data_size int, free_data int) int
fn (s &C.FONScontext) clear_state()
fn (s &C.FONScontext) draw_debug(x f32, y f32)
Draws the stash texture for debugging
fn (s &C.FONScontext) draw_text(x f32, y f32, str byteptr, end byteptr) f32
Draw text
fn (s &C.FONScontext) expand_atlas(width int, height int) int
Expands the atlas size.
fn (s &C.FONScontext) get_atlas_size(width &int, height &int)
Returns current atlas size.
fn (s &C.FONScontext) get_font_by_name(name byteptr) int
Add fonts
fn (s &C.FONScontext) get_texture_data(width &int, height &int) byteptr
Pull texture changes
fn (s &C.FONScontext) line_bounds(y f32, miny &f32, maxy &f32)
fn (s &C.FONScontext) pop_state()
fn (s &C.FONScontext) push_state()
State handling
fn (s &C.FONScontext) reset_atlas(width int, height int) int
Resets the whole stash.
fn (s &C.FONScontext) set_align(align int)
fn (s &C.FONScontext) set_blur(blur f32)
fn (s &C.FONScontext) set_color(color u32)
fn (s &C.FONScontext) set_error_callback(callback fn (voidptr, int, int), uptr voidptr)
fn (s &C.FONScontext) set_font(font int)
fn (s &C.FONScontext) set_size(size f32)
State setting
fn (s &C.FONScontext) set_spacing(spacing f32)
fn (s &C.FONScontext) text_bounds(x f32, y f32, str byteptr, end byteptr, bounds &f32) f32
Measure text
fn (s &C.FONScontext) text_iter_init(iter &C.FONStextIter, x f32, y f32, str byteptr, end byteptr) int
Text iterator
fn (s &C.FONScontext) text_iter_next(iter &C.FONStextIter, quad &C.FONSquad) int
fn (s &C.FONScontext) validate_texture(dirty &int) int
fn (s &C.FONScontext) vert_metrics(ascender &f32, descender &f32, lineh &f32)
struct C.FONSfont {}
struct C.FONSparams {
width int
height int
flags char
userPtr voidptr
renderCreate fn (voidptr, int, int) int
renderResize fn (voidptr, int, int) int
renderUpdate fn (voidptr, &int, byteptr)
renderDraw fn (voidptr, &f32, &f32, &u32, int)
renderDelete fn (voidptr)
}
struct C.FONSquad {
x0 f32
y0 f32
s0 f32
t0 f32
x1 f32
y1 f32
s1 f32
t1 f32
}
struct C.FONStextIter {
x f32
y f32
nextx f32
nexty f32
scale f32
spacing f32
codepoint u32
isize i16
iblur i16
font &FONSfont
prevGlyphIndex int
str byteptr
next byteptr
end byteptr
utf8state u32
}