AddTextToPath(id, t$[, table])
t$
to the current path. The
text will be added to the path as vector graphics. Because of that, this
command will only work when a vector font (e.g. a TrueType font) is
currently active. It will not work with bitmap fonts. AddTextToPath()
will use the active font that was set by the last call to SetFont() or
UseFont().
Please note that AddTextToPath()
will add the text above the current
y-point. Thus, if the path's current y-point is 240 and you add text
to it that is 36 pixels high, the text will be placed at an y-position
of 204 (240-36=204) instead of 240 as the current y-point might suggest.
Please note that there are currently some restrictions:
AddTextToPath()
must have been opened using
#FONTENGINE_INBUILT
. Fonts that have been opened using #FONTENGINE_NATIVE
will currently not work. The default inbuilt fonts #SANS
, #SERIF
, and
#MONOSPACE
will work just fine with AddTextToPath()
.
AddTextToPath()
.
If you want italic or bold text, you need to open a separate font that
has the bold and/or italicized vector graphics already in its face
data. Simply calling SetFontStyle() does not work with vector text.
AddTextToPath()
. It is currently
not possible to use formatting tags with this command.
The optional argument table
allows you to specify further options. The
following tags are currently recognized:
Encoding:
t$
. This defaults to the text library default encoding
set by SetDefaultEncoding()).
See SetDefaultEncoding for details.
EnableLayers SetFillStyle(#FILLCOLOR) SetFormStyle(#ANTIALIAS) SetFont("Arial", 100, {Engine = #FONTENGINE_INBUILT}) StartPath(1) MoveTo(1, 0, 0) AddTextToPath(1, "Hello World") DrawPath(1, #CENTER, #CENTER + 100, #BLUE, {AnchorX = 0.5, AnchorY = 0.5, Rotate = 45})The code above creates a vector path containing the text "Hello World". The path is then drawn using rotation by 45 degrees.