Skip to content

finite_draw_set_font

The finite_draw_set_font function attempts to set the font of future text.

void finite_draw_set_font(FiniteShell *shell, char *font_name, bool isItalics, bool isBold, int size)
TypeDescription
FiniteShell *shellThe FiniteShell where the window is.
char *font_nameThe name of the font.
bool isItalicsToggles text italics.
bool isBoldToggles text boldness.
int sizeThe size of the text.
#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);

If FiniteShell.cr is undefined, this function will create a new Cairo draw tool and set it to FiniteShell.cr

When using this function to setup text loading, you must use a valid libfinite function. Currently, the Cubix Infinite supports these fonts:

This function should be called whenever you’re planning on changing the size or style of text. It will only impact text drawn after it’s been called.

This function must have a valid FiniteShell

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