font_glyph_rotate_270(9)
π« font_glyph_rotate_270 β a little kernel function that spins your glyph a full 270Β° clockwise π
okay so bestie, this one lives in the Kernel API Manual (section 9, the kernel-functions section, iykyk) and it's genuinely iconic β it takes a glyph pattern and rotates it 270Β° in the clockwise direction. that's three quarters of a turn. slay.
β¨ SYNOPSIS β¨
void font_glyph_rotate_270 (const unsigned char *glyph , unsigned int
width , unsigned int height , unsigned char *out );
that's the whole signature, no cap. it returns void β nothing comes back out of it, everything happens through out. π
π ARGUMENTS π
glyphβ the glyph you want to rotate. it's aconst unsigned char *, so like, you're not allowed to mess with it, it's just here to be read. π«Άwidthβ the glyph width, measured in bits per scanline. yes, bits, not bytes. we're fancy like that. β¨heightβ the number of scanlines in the glyph. that's your vertical situation. πoutβ the rotated glyph bitmap. this is where the magic lands. you bring the buffer, bestie, the function does not allocate it for you. π
πΈ DESCRIPTION πΈ
okay so the way that this works is: width and height are describing the input glyph, the one sitting in glyph. the caller has to provide that output buffer out themselves, and it has to be of sufficient size to hold the rotated glyph β nobody's checking, nobody's resizing, that's on you. π
and here's the tea: rotating by 270Β° flips the width and height for the output glyph. so like, what was wide becomes tall and what was tall becomes wide. that's just the geometry of it. π
and ngl, here's the part where people get caught out β depending on the glyph pitch, the size of the output glyph can actually be different than the size of the input. not just swapped-axes different, but genuinely a different size, because pitch be like that sometimes. π§
so when you're allocating your output memory, take that into account. seriously. do the math first. this is not a "figure it out later" situation. π
π¦ SEE ALSO π¦
these are the other rotation besties (all in the kernel file ./lib/fonts/font_rotate.c, go say hi π):
π the sign-off π
sending you off with the deets: this page is sourced from ./lib/fonts, dated October 2026, and it's font_glyph_rotate_270(9) all day long. go rotate something cute. periodt. π₯ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms