TICKIT_RENDERBUFFER_TEXT_AT(3)

πŸ’– TICKIT_RENDERBUFFER_TEXT(3) πŸ’–

okay bestie, so this is a page from the Library Functions Manual and it's all about tickit_renderbuffer_text, tickit_renderbuffer_text_at β€” aka the girls who create text regions ✨ (yes that's the whole NAME section, we're not skipping a crumb of it)


✨ SYNOPSIS ✨

#include <tickit.h>

int tickit_renderbuffer_text(TickitRenderBuffer *rb,
        const char *text);
int tickit_renderbuffer_textn(TickitRenderBuffer *rb,
        const char *text, size_t len);
int tickit_renderbuffer_textf(TickitRenderBuffer *rb,
        const char *fmt, ...);
int tickit_renderbuffer_vtextf(TickitRenderBuffer *rb,
        const char *fmt, va_list args);

int tickit_renderbuffer_text_at(TickitRenderBuffer *rb,
        int line, int col, const char *text);
int tickit_renderbuffer_textn_at(TickitRenderBuffer *rb,
        int line, int col, const char *text, size_t len);
int tickit_renderbuffer_textf_at(TickitRenderBuffer *rb,
        int line, int col, const char *fmt, ...);
int tickit_renderbuffer_vtextf_at(TickitRenderBuffer *rb,
        int line, int col, const char *fmt, va_list args);

Link with -ltickit.
ngl the Link with -ltickit. line is lowkey the most important line here, don't forget it or the linker will simply Not πŸ’€

πŸ¦‹ DESCRIPTION πŸ¦‹

tickit_renderbuffer_text() creates a text region that starts at the current virtual cursor position, holding the text string you handed it and set to the current pen. it's giving "just drop this text right here where I'm standing" πŸ’…

tickit_renderbuffer_textn() creates a text region of at most len bytes. it returns the number of columns that the text string occupies. slay, measured and everything πŸ“βœ¨

tickit_renderbuffer_textf() and tickit_renderbuffer_vtextf() take a format string in the style of sprintf(3) to create formatted text from either a list of arguments or a va_list. these functions will update the virtual cursor position.


tickit_renderbuffer_text_at(), tickit_renderbuffer_textn_at(), tickit_renderbuffer_textf_at() and tickit_renderbuffer_vtextf_at() create a text region at the given position, and otherwise operate analogously to their non-_at counterpart. these functions do not use or update the virtual cursor position. no cursor drama, they just show up exactly where you told them to 🎯


🧺 storage tea (the part nobody warns you about)

Calls to any of these functions allocate storage owned by the TickitRenderBuffer instance itself to store the strings. that storage gets released again by:

heads up fr fr: that memory belongs to the render buffer, not to you. don't go freeing it yourself, that's not the vibe πŸ™ˆ

⭐ RETURN VALUE ⭐

These functions return an integer giving the number of columns the new region occupies. cute, concise, informative. periodt πŸ’–


🌈 SEE ALSO 🌈


and that's the whole page bestie, no crumbs left behind 🫢

signing off from the Library Functions Manual β€” this was TICKIT_RENDERBUFFER_TEXT(3), mwah πŸ’‹