font_data_rotate(9)
π font_data_rotate(9) β the group-chat version β¨
okay so bestie, this is font_data_rotate(9) from the Kernel API Manual, and honestly? it's giving "spin the glyph until the display stops being sideways" π
no cap, let's get into it.
β¨ NAME β¨
font_data_rotate β rotate font data by multiples of 90Β° π
π¦ SYNOPSIS π¦
unsigned char * font_data_rotate (font_data_t *fd , unsigned int width ,
unsigned int height , unsigned int charcount , unsigned int steps ,
unsigned char *buf , size_t *bufsize );
like, that's the whole vibe. seven args, one function, zero chill π₯
πΈ ARGUMENTS πΈ
fdβ the font data you wanna rotate, bestie. that's the main character π«Άwidthβ the glyph width in bits per scanline πheightβ the number of scanlines in the glyph, aka how tall our little glyph is π§charcountβ the number of glyphs in the font, count 'em πstepsβ number of rotation steps of 90Β°, one step = one twist π«bufβ preallocated output buffer; lowkey can beNULLπbufsizeβ the size ofbufin bytes; also can beNULLβ
π DESCRIPTION π
so the parameters width and height refer to the visible number of pixels and scanlines in a single glyph, fr fr β like what you actually see, not some internal padding situation. the number of glyphs is given in charcount. iconic.
rotation happens in steps of 90Β°. the steps parameter can have any value, but only 0 to 3 produce distinct results β that's the tea β. with 4 or higher, a full rotation has been performed, so you've kind of looped back around to the same vibe. you can pass any value for steps and the helper will perform the appropriate rotation. slay, it handles the math for you π
note that the returned buffer is not compatible withfont_data_t. it only contains glyph data in the same format as returned byfont_data_buf. so don't go treating it like a font object, bestie, it will not eat π
callers are responsible to free the returned buffer with kfree. yes, that's on you. no takebacks π«Ά
font rotation typically happens when displays get re-oriented β you know, screens rotating, hardware being chaotic, the usual π. to avoid unnecessary re-allocation of the memory buffer, the caller can pass in an earlier result buffer in buf for reuse β»οΈ. the old and new buffer sizes are given and retrieved by the caller in bufsize. the allocation semantics are compatible with krealloc. so yeah, krealloc energy, periodt β¨
π RETURN π
a buffer with rotated glyphs on success π, or an error pointer otherwise π
π₯ SEE ALSO π₯
- Kernel file
./lib/fonts/font_rotate.c font_glyph_rotate_90(9)font_glyph_rotate_180(9)font_glyph_rotate_270(9)
all the little rotation besties, iykyk π
β okay that's the whole page, you ate that reading it π this came from./lib/fontsand it's dated October 2026 β and the title's literallyfont_data_rotate(9)in case you forgot already π mwah, go rotate something, ilysm π«Άπ
π¦ 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