render_text(3)
β¨ 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 β
- Some format string states carry over between
render_textcalls β like the currently active font/size (this is to cut down onontfile.ttf,numstyle preludes, iykyk). - The returned
widthandheightdoes not necessarily match the values returned bytext_dimensionsπ β don't come for me, that's just how it is. Pfname,w,hfunction clamp to a built in limit (typically256x256) π.
π¦ SEE ALSO π¦
text_dimensions(3)β go read her too, she's iconic π
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
- nixos 26.05: arcan 0.7.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms