---
name: "register_font_file_type"
section: "3alleg4"
platform: "linux"
package: "allegro4-doc"
version: "2:4.4.3.1-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/register_font_file_type/3alleg4"
---

# register\_font\_file\_type(3alleg4)

Register a new font loading function. Allegro game programming library.

## NAME

register\_font\_file\_type - Register a new font loading function. Allegro game programming library.

## SYNOPSIS

**#include \<allegro.h\>**

**void register\_font\_file\_type(const char \*ext,** **FONT \*(\*load)(const char \*filename, RGB \*pal, void \*param));**

## DESCRIPTION

Informs the load\_font() functions of a new file type, providing a routine  to read fonts in this format. The function you supply must follow the  following prototype:

```
   FONT *load_my_font(const char *filename, RGB *pal, void *param)
   {
      ...
   }
```

The pal parameter can optionally be used to return a palette for the FONT. The parameter param can be anything you like: you can use this to pass information to your loading routine, such as for instance the font height, the character range to load or the index number of a font in a datafile. If you choose to write your own font loading code, your function should be prepared to deal with a value of NULL for either of these parameters.

## SEE ALSO

**load\_font**(3alleg4)
