A SERVICE OF

logo

108 Chapter 3
Wrap - if specified, its value forces a new line whenever the text gets longer than the
specified number of pixels (in this case correct word breaking is used).
Angle - allows the text to be rotated clockwise by the specified angle (in degrees).
Line - specifies the line spacing. The default spacing between lines of text is 1.5.
Smooth - specifies that the text is drawn with five-level anti-aliasing.
SmoothFactor - specifies the power of two for image scale-based smoothing. If “1” is
specified, the text will be drawn at twice the specified size and scaled down. If “2” is
specified, the text is drawn at four times the size. This scaling produces smoother text for
renderers with poor anti-aliasing at smaller text sizes. The Smooth parameter must be set
to “true” for this parameter to have any effect.
Baseline - if specified, the text is treated as though it is always the height of the largest
character. This allows text to be aligned between different calls to the function. The
distance, in pixels, between the baselines of two lines of text is 1.5 times the point-size of
the text. Thus for 30-point text the line spacing is 45 pixels. If this parameter is not specified,
makeText measures the actual height of the text and centers it accordingly.
Kern - if set to “true”, optimizes the spacing between text characters. By default this is set
to true. If you do not want to use kerning, this must be specified as false.
NOTE: PostScript fonts store the Kerning information in a separate file with a .afm extension. This
file must be present in order for kerning to be applied to the text.
DPI - allows you to specify the image resolution in dots per inch (DPI).
NOTE: The DPI parameter is not available if MediaRich is running on Mac, Linux, or Solaris.
Fillcolor - specifies the color to be used for the background. The default value is black.
ClearType - if specified as “true”, the Windows ClearType text renderer will be used if
available.
FitText - if specified as “true”, any empty space surrounding the generated text is
removed.
Example
var image = new Media();
image.makeText(text @ "Your message goes here.",Font @ "Arial",
Style @ "Bold", color @ 0xffff00, smooth @ true);
image.save(type @ "jpeg");