Version 11 of Rotate text on a canvas

Updated 2008-11-03 06:38:50 by kbk

Christian wrote once into c.l.t.:

BLT can create (semi-transparent) bitmaps of text in arbitrary directions.

Try the following:


     package require BLT
     ::blt::bitmap compose myNewBitmap "this is a text" \
         -font "Arial 10 bold" \
         -rotate 90 \
         -justify left
     $myCanvas create bitmap 50 50 -bitmap myNewBitmap \
         -foreground blue \
         -anchor nw \
         ...

This works nicely.


RS: Shouldn't the font rather be called Arial (or Helvetica, for even more platform-independence)?


It's nice on the screen, but less nice on postscript output. Ability to rotate any standard canvas object would be a nice upgrade to Tk. IDG

RS: see photo image rotation and canvas rotation (for lines and polygons)


But blt-bitmaps cannot be destroyed, so the memory will be full of bitmaps when using this way too often.


See Rotated canvas text for how some X servers can do this with pure Tk


KBK 2008-11-03 Or look at http://wiki.tcl.tk/_repo/hershey/ for a way to do it in pure Tcl/Tk with only line drawing.

Category BLT