---
name: "transpose_font"
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/transpose_font/3alleg4"
---

# transpose\_font(3alleg4)

Transposes all characters in a font. Allegro game programming library.

## NAME

transpose\_font - Transposes all characters in a font. Allegro game programming library.

## SYNOPSIS

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

**int transpose\_font(FONT \*f, int drange)**

## DESCRIPTION

This function transposes all characters in a font, effectively remapping the font. Example:

```
   FONT *myfont;
   FONT *capitals;
   ...
   /* Create a font of only capital letters */
   capitals = extract_font_range(myfont, 'A', 'Z');
   /* Now transpose the characters in the font so that they will be used */
   /*  for the lower case letters a-z */
   transpose_font(capitals, 'a'-'A');
   textout_ex(screen, capitals, "allcaps",
              100, 100, makecol(255,255,255), 0);
```

## RETURN VALUE

Returns 0 on success, -1 on failure.

## SEE ALSO

**get\_font\_range\_begin**(3alleg4), **get\_font\_range\_end**(3alleg4), **merge\_fonts**(3alleg4), **extract\_font\_range**(3alleg4)
