Re: Underlining text on canvas



On 30 Dec 2005 12:36:19 -0800, "bluetit" <capricious.falcon@xxxxxxxxx>
wrote:

>Given a text tag on a canvas, I would like to underline one letter in
>that text... using font measure to get it's start and end point and
>then drawing a line with those coords doesn't do a good job (line does
>not evenly underline the character, with some characters it's to the
>right more, with others to the left more).
Hi Tom,
the tags of the text widget have an underline option which you could
use like
---
pack [text .t]
..t tag configure ul -underline 1
..t insert end "Some "
# "tag" any text you want
..t insert end "T" ul
..t insert end "ext"
---
Uups, re-reading your post I just notice that you are talking of a
text item on a canvas. Now, the canvas supports the tagging mechanism
as well, but I don't know if 'underline' is available for its text
items.

HTH nonetheless
Helmut Giese
.



Relevant Pages

  • Re: Underlining text on canvas
    ... The reason I'm using a canvas is so I can have a background ... a text widget will give a white square over the bg image, ... # index of char to underline ... The reason I did it this way was so the text was all one tag, ...
    (comp.lang.tcl)
  • Underlining text on canvas
    ... Given a text tag on a canvas, I would like to underline one letter in ... using font measure to get it's start and end point and ... not evenly underline the character, with some characters it's to the ...
    (comp.lang.tcl)
  • Re: Tk::Canvas (i) how to get an id? (ii) vertical text?
    ... First question to you: given a Canvas tag, how to find the id's of the ... Here is a Zinc rotate text. ...
    (comp.lang.perl.tk)
  • Canvas undo: how many tags can I use?
    ... uses the Tk canvas as its drawing surface, ... the same geometry machinery to render its output on other ... for the canvas, that need to be kept in step; ... as I construct it in the geometry system; that tag can ...
    (comp.lang.tcl)
  • Re: Speedup canvas itemconfigure -fill for many polygons.
    ... I'm already using the canvas ... id in the canvas itemconfigure command (using a tag is woefully ... What exactly is slow with a tag? ... id (using the all tag to change colors works with no noticable ...
    (comp.lang.tcl)