Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9636
Modified Files: Tag: desiredata desire.tk Log Message: even more on fonts stuff
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.600.2.343 retrieving revision 1.1.2.600.2.344 diff -C2 -d -r1.1.2.600.2.343 -r1.1.2.600.2.344 *** desire.tk 11 Aug 2007 08:54:23 -0000 1.1.2.600.2.343 --- desire.tk 11 Aug 2007 18:12:32 -0000 1.1.2.600.2.344 *************** *** 2521,2525 **** bind $t <Control-n> "$self scroll_history -1" bind $t <Alt-BackSpace> "$self clear" - }
--- 2521,2524 ---- *************** *** 2572,2582 **** #set z [$@canvas zoom] set z 1 set pix_height [$t count -update -ypixels 1.0 end] ! set pix_width [$t count -update -xpixels "1.0" "1.0 lineend"] mset {width height} [$self get_size $pix_width $pix_height] $t configure -width [min $width $@max_width] -height $height -wrap word }
- #talks pixel value and return char units def TextBox get_size {w h} { set c [$self cwidget] --- 2571,2581 ---- #set z [$@canvas zoom] set z 1 + mset {x1 y1 x2 y2} [$c bbox ${self}text] set pix_height [$t count -update -ypixels 1.0 end] ! set pix_width [font measure [$self look font] [$t get 1.0 end]] mset {width height} [$self get_size $pix_width $pix_height] $t configure -width [min $width $@max_width] -height $height -wrap word }
def TextBox get_size {w h} { set c [$self cwidget] *************** *** 2586,2590 **** set char_width [font measure [$self look font] 0] set line_height [font metrics [$self look font] -linespace] ! set round_chars [expr int(ceil($pix_width/$char_width))+2] if {$round_chars < $@max_width && !$@multi} { set round_lines 1 --- 2585,2589 ---- set char_width [font measure [$self look font] 0] set line_height [font metrics [$self look font] -linespace] ! set round_chars [expr int(ceil($pix_width/$char_width.0))] if {$round_chars < $@max_width && !$@multi} { set round_lines 1