al_get_text_dimensions(3alleg5)

al_get_text_dimensions3alleg5

Allegro 5 api

Usage

#include <allegro5/allegro_font.h>
void al_get_text_dimensions(const ALLEGRO_FONT *f,
   char const *text,
   int *bbx, int *bby, int *bbw, int *bbh)

Overview

Sometimes, the al_get_text_width(3alleg5) and al_get_font_line_height(3alleg5) functions are not enough for exact text placement, so this function returns some additional information.

Returned variables (all in pixels):

•

x, y - Offset to upper left corner of bounding box.

•

w, h - Dimensions of bounding box.

Note that glyphs may go to the left and upwards of the X, in which case x and y will have negative values.

Releases

6 releases since Debian 8 (Jessie); the text changed 5 times.

  1. 8
  2. 9
  3. 10
  4. 11
  5. 12
  6. 13

From allegro5-doc 2:5.2.10.1+dfsg-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.