font_data_rotate(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŒ€ 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 be NULL πŸ™ˆ
  • bufsize β€” the size of buf in bytes; also can be NULL ⭐

πŸ’– 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 with font_data_t. it only contains glyph data in the same format as returned by font_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 πŸ”₯

all the little rotation besties, iykyk πŸ’œ


⭐ okay that's the whole page, you ate that reading it πŸ’… this came from ./lib/fonts and it's dated October 2026 β€” and the title's literally font_data_rotate(9) in case you forgot already πŸ™ˆ mwah, go rotate something, ilysm πŸ«ΆπŸ’–
πŸ“¦ where this page comes from