1al_get_text_dimensions(3) al_get_text_dimensions(3)
2
3
4
6 al_get_text_dimensions - Allegro 5 API
7
9 #include <allegro5/allegro_font.h>
10
11 void al_get_text_dimensions(const ALLEGRO_FONT *f,
12 char const *text,
13 int *bbx, int *bby, int *bbw, int *bbh)
14
16 Sometimes, the al_get_text_width(3) and al_get_font_line_height(3)
17 functions are not enough for exact text placement, so this function re‐
18 turns some additional information.
19
20 Returned variables (all in pixels):
21
22 • x, y - Offset to upper left corner of bounding box.
23
24 • w, h - Dimensions of bounding box.
25
26 Note that glyphs may go to the left and upwards of the X, in which case
27 x and y will have negative values.
28
30 al_get_text_width(3), al_get_font_line_height(3), al_get_ustr_dimen‐
31 sions(3)
32
33
34
35Allegro reference manual al_get_text_dimensions(3)