Version 0 of Shaded text on canvas

Updated 2005-11-15 11:31:37 by suchenwi

Richard Suchenwirth 2005-11-15 - Here's a simple effect to make canvas text items look nicer: the text is drawn twice, slightly shifted by a pixel in x and y direction. The font used should best be not the regular small one.

http://mini.net/files/shadetext.jpg

 package require Tk

 proc shadedtext {w x y fg bg args} {
   eval [list $w create text $x $y -fill $bg] $args
   eval [list $w create text [incr x -1] [incr y -1] -fill $fg] $args
 }

## Demo:

 pack [canvas .c]
 shadedtext .c 10 30 yellow black -text hello -font {Times 36 bold} -anchor w
 shadedtext .c 10 80 orange red -text world -font {Times 36 bold} -anchor w

Arts and crafts of Tcl-Tk programming