Rotate text on a canvas

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.

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

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)

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

KBK 2008-11-03 Or look at for a way to do it in pure Tcl/Tk with only line drawing.

Lars H, 2008-11-03: That directory appears to be empty. But what kind of fontsize would this allow? Probably not anything near the 10 shown above, since XLEL limits Tk to pixel precision.

Lars H, 2008-11-04: OK, the Half Bakery contents appears to be back. And answering my own question: the font size used by the demo program appears to be 33.

lm 2008-11-04 : Notice that the pixane package from evolane ( -> Projects -> pixane) is an extension that allow to create bitmap/photo images rotated. It's available for almost all platforms.

stever 2008-11-08: Pixane/eTcl is a good example of why I use Tcl/Tk: to get away from proprietary binary only solutions. My business policy prohibits placing projects at risk by depending on the existence of a proprietary 3rd party. Sure, I personally use eTcl on my PocketPc, but I'd never develop a commercial app with eTcl (on any platform) unless I had a copy of its source code. It appears Evolane is "too busy" to give back to the community the same value that they enjoy from using an open source language. Luckily for them, the BSD license permits this. Luckily for me, I don't have to use their product and put mine at risk if they vaporize.

DKF: Tk 8.6 now has a rotated text engine for the canvas. Just set the -angle on text items to engage.