Prints anti-aliased text using a TrueType/OpenType or Type 1 font specified by its physical path.
Supports word wrapping, rotation, text alignment (to the left, right, center and justified) and adjustable line spacing.
Text - specifies the text string to be printed (in Unicode format). May contain
CR/LF characters for multi-line display.
X, Y - coordinates of the lower-left corner of the first character of the first line,
relative to the upper-left corner of the image.
FontPath - specifies a physical path to the font file. The font does not need to be properly registered on the system
as long as the path to the font file is known.
Additional optional parameters are specified via the following properties:
PenColor - specifies the text color index.
FontRotation - specifies the rotation angle around the (X, Y) point in degrees. A positive
value creates a counter-clockwise rotation.
FontSize - specifies font size in pixels.
FontSpacing - specifies an adjustment in pixels for the default line spacing when multi-line text
is being rendered. A positive value increases the line spacing, a negative one decreases it.
FontWidth - specifies the width of an area in which the text string is to be inscribed.
Word wrapping occurs if the text string does not fit in the area.
This property must also be set if non-default
text alignment is specified via FontAlign.
FontAlign - specifies text alignment. Valid values are: 0 - left (default), 1 - right,
2 - center, and 3 - justified. For values other than 0, FontWidth must also be specified.
Returns the width (in pixels) of the text string being drawn. If the string is split into
multiple lines, returns the width of the longest line.