render_text(3)

πŸ“¦
version 0.7.1 Β· 2 versions
, in nixos 26.05

✨ render_text(3) ✨

okay so bestie, we're in the Arcan Lua API section of the manual and today's main character is render_text πŸ’…


πŸŽ€ NAME πŸŽ€

render_text β€” literally converts a format string into a shiny new video object ✨


🌸 SYNOPSIS 🌸

vid, lineheights, width, height, ascent
render_text( dststore, message, vspacing, tspacing, tabs )

πŸ’– DESCRIPTION πŸ’–

So what it does is render a format string into a texture that gets assigned to a brand-new video object πŸ¦‹. You get that object back, plus a table of the individual line-heights β€” adorable, right? 😌

Now, the optional dststore β€” she's the glow-up option πŸ’… β€” you can use her to update a previous result from render_text. That cuts down on costs for dynamic allocation and on recreating or rebuilding related vid hierarchies. The catch (and yes there's always a catch, bestie 😭): custom texture coordinates from cropping and similar operations may still need to be reapplied. No cap.

Render behavior varies with the type of message, which can be a string or an n-indexed table of strings. Anything else is a terminal state transition πŸ’€.

If message is a string, all contents are treated as a format string β€” and that's dangerous with user-supplied content, because escaping and dynamic string construction is costly. Fr fr, be careful πŸ™ˆ.

If message is a table of strings, then the strings at odd indices are treated as format strings and the ones at even indices are treated as raw UTF 8 🌈.

vspacing tells you the default padding between lines, and tspacing is the horizontal spacing between tabs. If vspacing is set to nil or 0, then the added padding gets taken from the font instead 🫢.

Each formatting sequence starts with a single backslash, followed by a command code (see the table below πŸ‘€). Stateful commands (b, i, u) can be negated with a preluding exclamation point 😌✨.


⭐ NOTES ⭐

  1. Some format string states carry over between render_text calls β€” like the currently active font/size (this is to cut down on ontfile.ttf,num style preludes, iykyk).
  2. The returned width and height does not necessarily match the values returned by text_dimensions 😭 β€” don't come for me, that's just how it is.
  3. Pfname,w,h function clamp to a built in limit (typically 256x256) πŸ’€.

πŸ¦‹ SEE ALSO πŸ¦‹


okay that's the whole vibe check, go forth and render πŸ’…βœ¨

mwah πŸ’‹ this page came from the image source, version is October 2026, and yes the date on the footer is October 2026 too β€” stan a consistent queen πŸŽ€πŸ’–πŸŒΈ

πŸ“¦ where this page comes from