Skip to content

finite_draw_set_text

The finite_draw_set_text function attempts to draw text to the screen.

void finite_draw_set_text(FiniteShell *shell, char *text, FiniteColorGroup *color)
TypeDescription
FiniteShell *shellThe FiniteShell where the window is.
char *textThe text the screen.
FiniteColorGroup *colorThe color of the text to draw.
#include <finite/draw.h>
finite_draw_set_font(myShell, "KunbhSans", false, false, 24);
FiniteColorGroup white = {
.r = 0,
.g = 0,
.b = 0
};
finite_draw_set_draw_position(myShell, 30, 20);
finite_draw_set_text(myShell, "Hello there!", &white);

This function is intended to be used to draw colored text to screen. However it does not take in a position. As such, you should call finite_draw_set_draw_position directly before each finite_draw_set_text call to ensure that things are rendered at the correctly.

This function must have a valid FiniteShell

This function uses Cairo which requires a valid cairo_surface_t in FiniteShell.cairo_surface beforehand.