---
name: "al_get_text_dimensions"
section: "3"
platform: "linux"
package: "allegro"
version: "5.2.11.3-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/al_get_text_dimensions"
---

# al\_get\_text\_dimensions(3)

Allegro 5 API

## NAME

al\_get\_text\_dimensions - Allegro 5 API

## SYNOPSIS

-

  ```
  #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)
  ```

## DESCRIPTION

Sometimes, the [al\_get\_text\_width(3)](/al_get_text_width/3.md) and [al\_get\_font\_line\_height(3)](/al_get_font_line_height/3.md) 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.

## SEE ALSO

[al\_get\_text\_width(3)](/al_get_text_width/3.md), [al\_get\_font\_line\_height(3)](/al_get_font_line_height/3.md), [al\_get\_ustr\_dimensions(3)](/al_get_ustr_dimensions/3.md)
