cf_make_font_from_memory¶
Category: text
GitHub: cute_draw.h
Constructs a font for rendering text from memory.
| 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¶
The font borrows data rather than copying it. Keep the buffer alive until cf_destroy_font (or cf_destroy_app)
releases the font, then free it yourself; CF never frees data.
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.
Related Pages¶
cf_make_font
cf_draw_text
cf_destroy_font
cf_push_font
cf_push_font_size
cf_push_font_blur