SourceForge has been redesigned. Learn more.
Close

#231 TIP#119: Rotated text for canvas

TIP Implementation
closed-accepted
8
2008-11-22
2006-12-08
No

This patch is a partial implementation of TIP#119, being for UNIX/X11 only. Needs Windows and OSX/Aqua implementations.

Thanks to Simon Geard for recovering the patch (which had been lost) and upgrading it to work with 8.5. :-)

Includes copy of xvertext 5.0; I think the license is Tcl/Tk-compatible.

Discussion

  • Daniel A. Steffen

    Logged In: YES
    user_id=90580
    Originator: NO

    a few comments from a quick read through the patch:
    - contains two copies of rotated.c and rotated.h in unix and xlib, if the right place for these is unix/ they should be renamed to conform to the tkUnix* pattern.
    - tkUnixPort.h includes rotated.h with a relative path which will not work in an install location.
    - three routines in the public stubs table are changed to take an additional angle param, this incompatibility is not discussed in the TIP, it might be better to introduce additional API that the originals call through.
    - changes tkDecls.h directly instead of tk.decls
    - tkCanvText.c contains leftover printf debugging and commented out bits
    - no tests or docs, testscript added to unix/

    The aqua implementation should be easy, all that should be required is to setup a rotation CTM before the ATSUI quartz text drawing.

     
  • Donal K. Fellows

    • priority: 7 --> 9
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2007-10-30

    Logged In: YES
    user_id=72656
    Originator: NO

    See also 220784 for old patch

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2007-10-30
    • priority: 9 --> 8
     
  • Donal K. Fellows

    Adding a partial implementation with some good features over the original.
    1) Not disruptive of any public API.
    2) Uses Xft for doing rotated text.
    3) Does the bounding box properly; animated rotating text works.
    4) Handles the text item's -underline option.

    Still to do:
    1) Adaptations for other renderers (should be easy for OSX and Win).
    2) Handle highlighting, the cursor and the caret.
    File Added: rotate.patch

     
  • Donal K. Fellows

    Here's a *highly buggy* version of the rotated text renderer for OSX. No idea what's wrong.
    File Added: rotate_mac.patch

     
  • Donal K. Fellows

    D'oh! Had the order of transforms wrong. Rotated text on OSX now works with the new patch.
    File Added: rotate.patch

     
  • Donal K. Fellows

    Patch with generic code finished.

    Missing:
    * Win renderer (tkWinFont.c)
    * Classic X11 renderer (tkUnixFont.c)
    * tests and docs!

    File Added: rotate.patch

     
  • Donal K. Fellows

    • assigned_to: hobbs --> dkf
     
  • Donal K. Fellows

    Added a renderer for classic X11 (slow on remote hosts, but works)
    File Added: rotate.patch

     
  • Donal K. Fellows

    Even-more-complete patch

     
  • Donal K. Fellows

    Patch for Win32

     
  • Donal K. Fellows

    See attached patch for Win32 renderer (probably incomplete, but Works On My Machine; remaining issues can be dealt with through bugs reports) which works in principle rather similarly to the Xft renderer (caching rotated system fonts...)

    All committed to CVS HEAD now. No chance of a backport though; this is too big, too painful.

    Note that this does not touch xvertext; too many bits and pieces from elsewhere were needed.
    File Added: win.patch

     
  • Donal K. Fellows

    • status: open --> closed-accepted