text is one of the standard [[canvas] item types
To get the dimensions of a text item, use [canvas bbox]. Examples:
'italic text'** Demos **
from simple to complex:
*** *** *** **** **`''
[http://here.com/photo.gif|png|jpg]http://here.com/what.html%|%link name%|%[your heading2]
''`** **** *** *** ***
'** Rotated Text ** bold text'
'' Ambika
sfsffddffgdfgbgfgfbold text rerrere''frfrfrrrf`frfrfrffr **frfrfrtrr ***rfrffrfrrf
*** ** `''
Text items are on a transparent background. You can give them an opaque background by first creating the text, then determining its b(ounding )box, drawing a rect with equal -fill and -outline, and finally raising the text item again. Example, where this happens on demand when the user clicks on a text:
$canvas bind text <1> { %W create rect [%W bbox current] -fill white -outline white -tag bg %W lower bg text } $canvas bind text <3> {%W delete bg} ;# RS