| Home | zeGraph lib | Lua lib | Custom lib | Tutorials | Notes | XML Script | C-Talk | Z-Script |
Graph
   axis
   blend
   color
   color bar
   fog
   freetype
   light
   line
   material
   node
   point
   plot
   polygon
   render
   scene
   stencil
   texcoord
   text
   texture
   vertex
Utility
   array
   bio
   hdf
   make
   math
   netcdf
Auxiliary
   curl
   expact
   sqlite
   window

zeText

Use .new("text") to create the object. It uses zeFreetype to generate texture-mapped text. The image can be transfered to an array and later used for texture or rendered as points.

:font(object)

Sets the Freetype object to be used to generate text bitmap.

:fontsize(size)

Sets the font size to the specified number of pixels per inch. It should be called before calling the text() function.

:text(string)

Parses the string and use the results as the text content. The tags of <sym> and </sym> mark the number between them as the Unicode of a character; <sup> and </sup> marks a string as superscript; and <sub> and <sub> makrs a string as subscript. The <sym> and </sym> tags also recognize Greek characters by name. Multi-bytes characters (e.g., Japanese and Chinese) can be used if the font file supports them. The functions returns the image width and height.

:set{...}

Sets text properties with a Lua table. Valid key-value pairs in the Lua table are listed as follows.

Key Value Type Remark
color {r, g, b, a} Numbers (0 to 1) in table Sets the text color.
layout {x0, y0, z0, x1, y1, z1, x2, y2, z2} Numbers in table Sets the plane on which the text will be drawn. The plane is determined by vectors from (x0,y0,z0) to (x1,y1,z1) and to (x2,y2,z2)
position {x, y, z, hor, vert} Numbers in table Position the object at (x, y, z) on the x-y plane. If hor =0, center alignment horizontally; if hor > 0, right alignment horizontally; otherwise left alignment horizontally. If ver =0, center alignment vertically; if ver > 0, top alignment vertically; otherwise bottom alignment vertically.
enable flag Boolean Enables or disables the object.

 

Greek Character Names

alpha: eta: nu: tau: Gamma: Sigma:
beta: theta: xi: upsilon: Delta: Phi:
gamma: iota: o: phi: Theta: Psi:
delta: kappa: pi: chi: Lambda: Omega:
epsilon: lambda: rho: psi: Xi:  
zeta: mu: sigma: omega: Pi: