uwidth(3alleg4)
β¨ NAME β¨
okay so bestie, this is uwidth from the Allegro manual (that's the 3alleg4 section, iykyk) β it's a low level helper function for testing Unicode text data. it also lives in the Allegro game programming library, so yeah, it's giving gamedev Unicode energy π
πΈ SYNOPSIS πΈ
#include <allegro.h>
int uwidth(const char *s);
π¦ DESCRIPTION π¦
low level helper function for testing Unicode text data. that's literally the whole vibe β it's a lil baby utility that hangs out down in the weeds so the higher-level Unicode stuff can do its thing π«Ά
π RETURN VALUE π
it returns the number of bytes occupied by the first character of the string you passed in, measured in the current encoding format. so like, not the whole string, bestie β just the first character, and in bytes, not characters. slay β¨
heads up: "current encoding format" is doing a lot of heavy lifting in that sentence, so if the numbers look weird to you, check what encoding you're actually in before you spiral π
π SEE ALSO π
the whole friend group, fr fr:
uwidth_max(3alleg4)ugetc(3alleg4)ugetx(3alleg4)usetc(3alleg4)ucwidth(3alleg4)uisok(3alleg4)
and that's the whole page, periodt π this was brought to you by Allegro, version 4.4.3 β go forth and measure your first Unicode character's byte width, main character energy only πβπ
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms