Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
render_text(3)			  Arcan Lua API 		  render_text(3)

NAME
     render_text - Convert a format string to a new video object.

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

DESCRIPTION
     Render  a	format string into a texture assigned to a new video object. Re-
     turn this object along with a table of  individual  line-heights.	The  op-
     tional  dststore  can be used to update a previous result from render_text,
     which cuts down on costs for dynamic allocation and recreating or	rebuild-
     ing  related  vid	hierarchies, with the caveat that custom texture coordi-
     nates from cropping and similar operations may still need to be  reapplied.
     Render  behavior varies with the type of message , which can be string or a
     n-indexed table of strings. Anything else is a terminal  state  transition.
     If  message    is a string, all contents will be treated as a format string
     which is dangerous with user  supplied  content  as  escaping  and  dynamic
     string  construction  is costly. If message  is a table of strings, strings
     at odd indices will be treated as	format	strings  and  even  indices  are
     treated as raw UTF 8. Vspacing indicates the default padding between lines,
     and  tspacing  the  horizontal spacing between tabs. If vspacing  is set to
     nil or 0, the added padding will be taken from the  font.	Each  formatting
     sequence is initiated with a single backslash, followed with a command code
     (see  table  below). Stateful commands (b, i, u) can be negated with a pre-
     luding exclamation point.

NOTES
     1	    Some format string states carry over between render_text calls, such
	    as the currently active font/size (to cut  down  on  ontfile.ttf,num
	    style preludes.

     2	    returned  width and height does not necessarily match the values re-
	    turned by text_dimensions

     3	    Pfname,w,h function clamp to a built in limit (typically 256x256).

SEE ALSO:
     text_dimensions(3)

image				   August 2026			  render_text(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=render_text&sektion=3&manpath=FreeBSD+Ports+15.1.quarterly>

home | help