Get text outline
Fri, 12/07/2018 - 07:40 pm
In order to follow some style guide, I would like to draw text tags with rounded rectangles. The Tag command seems to support only rectangular boxes. So I worked with DrawText and really felt delighted about the drawing toolbox. I followed the idea to write text with DrawText, read back the outline with DrawAction extractOutline and then draw a rounded rectangle around it. Nevertheless I did not succeed in reading back any text outline.
DrawAction extractOutline works nicely on geometrical objects like DrawRect, but it seems to totally ignore DrawText commands. And it also seems to ignore DrawLine commands.
Here is one example
variable dy = -40
SetDrawEnv gstart, gname=this
SetDrawEnv xcoord=bottom, ycoord=left
SetDrawEnv origin = MyXWave, MyYWave
DrawLine 0, 0, dx, dy
SetDrawEnv origin = dx, dy
DrawText 0, 0, "This\ris a\rtest"
DrawAction getgroup=this, extractOutline
It yields empty W_PolyX and W_PolyY waves.
Is there any other way?