AddText

Function
This function differs from the Image function Text only in that it places text over a pre-existing background. See the Text page for full documentation on this extremely flexible feature. Its also a little nicer than Text for the command line because you don't have to actually place in all of the parameters for the image width and height, etc.

Parameters
Type
Defaults
Function
text string "Text" The text you want to print.
font
string
"Utopia Regular" The font you wish to use.
x,yFontScale
float
100,100 Size of the font.
leading
float
1 leading to control space between lines.
x/yPos float width/2, height/2 The center of the text. Keep in mind this does not represent the geometric center of the text, but only in relation to the characteristics of the particular font you are using, so it will change from font to font, and also by your x/yAlign values.
x/yAlign int 2,2

0 = left/top justified
1 = right/bottom justified
2 = centered

red, green, blue, alpha float 1,1,1,1 Your color values, ranging (usually) from 0 to 1.
x,y,zAngle float 0,0,0 Rotations on the image.
fieldOfView float 0 degrees of view. If this is value, your x- and yAngle values will appear to have no effect.
kerning float 0 The spacing between each letter. You can also have negative values.
fontQuality float 1 The polygonalization factor of the font splines. We have conservatively set this to a high value. For flat artwork, you can probably get away with a value of 0. When you have extreme perspective, you will want to keep it high.

 

Synopsis

image AddText( 
  image img,
  const char * text,
  const char * font,
  float xScale,
  float yScale,
  float leading,
  float xPos,
  float yPos,
  float zPos,
  int xAlign,
  int yAlign,
  float red,
  float green,
  float blue,
  float alpha,
  float xAngle,
  float yAngle,
  float zAngle,
  float fieldOfView,
  float kerning,
  float fontQuality
);


Script

image AddText( 
  image, 
  "text",
  "font",
  xScale,
  yScale,
  leading,
  xPos,
  yPos,
  zPos,
  xAlign,
  yAlign,
  red,
  green,
  blue,
  alpha,
  xAngle,
  yAngle,
  zAngle,
  fieldOfView,
  kerning,
  fontQuality
);


Command Line

-addtext text font xScale yScale etc...


Examples

shake lisa.iff -addt "Hello World" "Courier" 50
shake -addtex "Today is %M %d, %D" "Courier" 30
shake lisa.iff -addtex "frame = %f" "Courier" 60 -t 1-10


See Also
Text