Text management
Just like the minilibx, the MacroLibX supports texts rendering using mlx_string_put
and some functions to load fonts.
🖊️ Text rendering
To render any text with the MacroLibX we only need to use mlx_string_put
like so :
🔤 Using fonts
The MacroLibX is also capable of using custom fonts (as long as it is a TTF) given by the user. To do so, we can use mlx_set_font
and mlx_set_font_scale
.
The difference between thoses are that mlx_set_font_scale
allows the user to scale the font as he/she wants.
We can even use several fonts in the same frame :
And if we want to use the default font again, we can pass "default"
as the font path (and we can scale it too).