Skip to main content

Module text

Module text 

Source
Expand description

Functions to load fonts and draw text.

Structs§

Font
TTF font loaded to GPU
TextDimensions
World space dimensions of the text, measured by “measure_text” function
TextParams
Arguments for “draw_text_ex” function such as font, font_size etc

Functions§

camera_font_scale
From given font size in world space gives (font_size, font_scale and font_aspect) params to make rasterized font looks good in currently active camera
draw_multiline_text
Draw multiline text with the given font_size, line_distance_factor and color. If no line distance but a custom font is given, the fonts line gap will be used as line distance factor if it exists.
draw_multiline_text_ex
Draw multiline text with the given line distance and custom params such as font, font size and font scale. If no line distance but a custom font is given, the fonts newline size will be used as line distance factor if it exists, else default to font size.
draw_text
Draw text with given font_size Returns text size
draw_text_ex
Draw text with custom params such as font, font size and font scale Returns text size
get_default_font
Returns macroquads default font.
get_text_center
Get the text center.
load_ttf_font
Load font from file with “path”
load_ttf_font_from_bytes
Load font from bytes array, may be use in combination with include_bytes!
measure_multiline_text
measure_text
set_default_font
Replaces macroquads default font with font.
wrap_text
Converts word breaks to newlines wherever the text would otherwise exceed the given length.