Version 15 of Rotate text on a canvas

Updated 2008-11-04 13:55:37 by lm

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.

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 (www.evolane.com -> Projects -> pixane) is an extension that allow to create bitmap/photo images rotated. It's available for almost all platforms.