1module fontstash
2
3pub enum FonsFlags {
4	top_left = 1
5	bottom_left = 2
6}
7
8pub enum FonsAlign {
9	// Horizontal align
10	left 		= 1	// Default
11	center 		= 2
12	right 		= 4
13	// Vertical align
14	top 		= 8
15	middle		= 16
16	bottom		= 32
17	baseline	= 64 // Default
18}
19
20pub enum FonsErrorCode {
21	// Font atlas is full.
22	atlas_full = 1
23	// Scratch memory used to render glyphs is full, requested size reported in 'val', you may need to bump up FONS_SCRATCH_BUF_SIZE.
24	scratch_full = 2
25	// Calls to fonsPushState has created too large stack, if you need deep state stack bump up FONS_MAX_STATES.
26	states_overflow = 3
27	// Trying to pop too many states fonsPopState().
28	states_underflow = 4
29}
30
31pub struct C.FONSparams {
32	width int
33	height int
34	flags char
35	userPtr voidptr
36	// int (*renderCreate)(void* uptr, int width, int height)
37	renderCreate fn(uptr voidptr, width int, height int) int
38	// int (*renderResize)(void* uptr, int width, int height)
39	renderResize fn(uptr voidptr, width int, height int) int
40	// void (*renderUpdate)(void* uptr, int* rect, const unsigned char* data)
41	renderUpdate fn(uptr voidptr, rect &int, data byteptr)
42	// void (*renderDraw)(void* uptr, const float* verts, const float* tcoords, const unsigned int* colors, int nverts)
43	renderDraw fn(uptr voidptr, verts &f32, tcoords &f32, colors &u32, nverts int)
44	// void (*renderDelete)(void* uptr)
45	renderDelete fn(uptr voidptr)
46}
47
48pub struct C.FONSquad
49{
50	x0 f32
51	y0 f32
52	s0 f32
53	t0 f32
54	x1 f32
55	y1 f32
56	s1 f32
57	t1 f32
58}
59
60pub struct C.FONStextIter {
61	x f32
62	y f32
63	nextx f32
64	nexty f32
65	scale f32
66	spacing f32
67	codepoint u32
68	isize i16
69	iblur i16
70	font &FONSfont
71	prevGlyphIndex int
72	str byteptr
73	next byteptr
74	end byteptr
75	utf8state u32
76}
77
78pub struct C.FONSfont {}
79
80pub struct C.FONScontext {}
81