1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/fontstash/fontstash_funcs.v

54 lines
1.9 KiB
V
Raw Normal View History

2020-01-16 22:45:47 +03:00
module fontstash
// Contructor and destructor.
fn C.fonsCreateInternal(params &C.FONSparams) &C.FONScontext
fn C.fonsDeleteInternal(s &C.FONScontext)
fn C.fonsSetErrorCallback(s &C.FONScontext, callback fn (voidptr, int, int), uptr voidptr)
2020-01-16 22:45:47 +03:00
// Returns current atlas size.
fn C.fonsGetAtlasSize(s &C.FONScontext, width &int, height &int)
2020-01-16 22:45:47 +03:00
// Expands the atlas size.
fn C.fonsExpandAtlas(s &C.FONScontext, width int, height int) int
2020-01-16 22:45:47 +03:00
// Resets the whole stash.
fn C.fonsResetAtlas(s &C.FONScontext, width int, height int) int
// Add fonts
fn C.fonsGetFontByName(s &C.FONScontext, name &char) int
2020-01-16 22:45:47 +03:00
fn C.fonsAddFallbackFont(s &C.FONScontext, base int, fallback int) int
fn C.fonsAddFontMem(s &C.FONScontext, name &char, data &byte, dataSize int, freeData int) int
2020-01-16 22:45:47 +03:00
// State handling
fn C.fonsPushState(s &C.FONScontext)
fn C.fonsPopState(s &C.FONScontext)
fn C.fonsClearState(s &C.FONScontext)
// State setting
fn C.fonsSetSize(s &C.FONScontext, size f32)
fn C.fonsSetColor(s &C.FONScontext, color u32)
fn C.fonsSetSpacing(s &C.FONScontext, spacing f32)
fn C.fonsSetBlur(s &C.FONScontext, blur f32)
fn C.fonsSetAlign(s &C.FONScontext, align int)
fn C.fonsSetFont(s &C.FONScontext, font int)
// Draw text
fn C.fonsDrawText(s &C.FONScontext, x f32, y f32, str &char, end &char) f32
2020-01-16 22:45:47 +03:00
// Measure text
fn C.fonsTextBounds(s &C.FONScontext, x f32, y f32, str &char, end &char, bounds &f32) f32
2020-01-16 22:45:47 +03:00
fn C.fonsLineBounds(s &C.FONScontext, y f32, miny &f32, maxy &f32)
fn C.fonsVertMetrics(s &C.FONScontext, ascender &f32, descender &f32, lineh &f32)
// Text iterator
fn C.fonsTextIterInit(s &C.FONScontext, iter &C.FONStextIter, x f32, y f32, str &char, end &char) int
2020-01-16 22:45:47 +03:00
fn C.fonsTextIterNext(s &C.FONScontext, iter &C.FONStextIter, quad &C.FONSquad) int
// Pull texture changes
fn C.fonsGetTextureData(s &C.FONScontext, width &int, height &int) &char
2020-01-16 22:45:47 +03:00
fn C.fonsValidateTexture(s &C.FONScontext, dirty &int) int
// Draws the stash texture for debugging
fn C.fonsDrawDebug(s &C.FONScontext, x f32, y f32)