transpose_font(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

✨ transpose_font(3) ✨

okay bestie, this page is straight from the Allegro manual, and we're about to make font remapping make sense. transpose_font does exactly what it says: it transposes all characters in a font. like, every character gets moved around so the font is effectively remapped. it's giving font glow-up. πŸ’…


🌸 NAME 🌸

transpose_font β€” Transposes all characters in a font. Part of the Allegro game programming library. πŸŽ€

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <allegro.h>

int transpose_font(FONT *f, int drange)

πŸŽ€ DESCRIPTION πŸŽ€

so this function transposes all characters in a font, effectively remapping the font. no cap. 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);

like, you pull out just the capitals with extract_font_range(myfont, 'A', 'Z'), then transpose_font(capitals, 'a'-'A') makes those capital glyphs get used for the lowercase letters a-z, and then textout_ex drops "allcaps" on screen. iconic. ✨

πŸ’– RETURN VALUE πŸ’–

Returns 0 on success, -1 on failure. simple as that. 🫢

πŸ”₯ SEE ALSO πŸ”₯


okay that's the whole vibe. from the Allegro manual, version 4.4.3. stay slay, bestie. πŸ’…βœ¨

πŸ“¦ where this page comes from