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)Parameters
Section titled “Parameters”| Type | Description |
|---|---|
FiniteShell *shell | The FiniteShell where the window is. |
char *font_name | The name of the font. |
bool isItalics | Toggles text italics. |
bool isBold | Toggles text boldness. |
int size | The size of the text. |
Code Example
Section titled “Code Example”#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
Standard Usage
Section titled “Standard Usage”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.