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.
This method was introduced in Version 1.8 as a more versatile alternative to the PrintText method.
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 Font object. The following
Font properties affect PrintTextEx:
Font.Color - specifies the current text color as a Hex value. E.g. &HFF0000FF is blue.
Font.Rotation - specifies the rotation angle around the (X, Y) point in degrees. A positive
value creates a counter-clockwise rotation.
Font.Size - specifies font size in pixels.
Font.Spacing - 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.
Font.Width - 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 Font.Align.
Font.Align - specifies text alignment. Valid values are: 0 - left (default), 1 - right,
2 - center, and 3 - justified. For values other than 0, Font.Width must also be specified.
Font.Opacity - specifies text opacity. Valid values are in the range [0, 1]
with 0 meaning full transparency and 1 full opacity.
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.
Starting with version 1.9, the height of the text paragraph just rendered
can be obtained via the property ParagraphHeight.
For more information, see Section 5.3 - Advanced Text Drawing with PrintTextEx.