---
name: "al_load_ttf_font"
section: "3alleg5"
platform: "linux"
package: "allegro5-doc"
version: "2:5.2.10.1+dfsg-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/al_load_ttf_font/3alleg5"
---

# al\_load\_ttf\_font(3alleg5)

Allegro 5 API

## NAME

al\_load\_ttf\_font - Allegro 5 API

## SYNOPSIS

-

  ```
  #include <allegro5/allegro_ttf.h>
  ALLEGRO_FONT *al_load_ttf_font(char const *filename, int size, int flags)
  ```

## DESCRIPTION

Loads a TrueType font from a file using the FreeType library. Quoting from the FreeType FAQ this means support for many different font formats:

*TrueType, OpenType, Type1, CID, CFF, Windows FON/FNT, X11 PCF, and* *others*

The `size` parameter determines the size the font will be rendered at, specified in pixels. The standard font size is measured in *units per EM*, if you instead want to specify the size as the total height of glyphs in pixels, pass it as a negative value.

*Note:* If you want to display text at multiple sizes, load the font multiple times with different size parameters.

The following flags are supported:

- •

  ALLEGRO\_TTF\_NO\_KERNING - Do not use any kerning even if the font file supports it.

- •

  ALLEGRO\_TTF\_MONOCHROME - Load as a monochrome font (which means no anti-aliasing of the font is done).

- •

  ALLEGRO\_TTF\_NO\_AUTOHINT - Disable the Auto Hinter which is enabled by default in newer versions of FreeType. Since: 5.0.6, 5.1.2

## SEE ALSO

al\_init\_ttf\_addon(3alleg5), al\_load\_ttf\_font\_f(3alleg5)
