Skip to content

cf_make_font_from_memory

Category: text
GitHub: cute_draw.h


Constructs a font for rendering text from memory.

CF_Result cf_make_font_from_memory(void* data, int size, const char* font_name);
Parameters Description
data A buffer containing the bytes of a font file in memory.
size The size of data in bytes.
font_name A unique name for this font. Used by cf_push_font and friends.

Return Value

Returns any errors as CF_Result.

Remarks

Memory is only consumed when you draw a certain glyph (text character). Just loading up the font initially is a low-cost operation. You may load up many fonts with low overhead. Please note that bold, italic, etc. are actually different fonts and each must be loaded up individually.

cf_make_font
cf_draw_text
cf_destroy_font
cf_push_font
cf_push_font_size
cf_push_font_blur