diff options
author | vincentdarley <vincentdarley> | 2003-12-04 12:09:55 (GMT) |
---|---|---|
committer | vincentdarley <vincentdarley> | 2003-12-04 12:09:55 (GMT) |
commit | a76a88dd975af2c49baceb473c4b1ace2c108b00 (patch) | |
tree | 9cff7de3afeb0dd3ffe36e6e86f94c00e27ad5e7 /tests/textDisp.test | |
parent | 10b48a13614bc3df04c2768fd34d84900deaeb41 (diff) | |
download | tk-a76a88dd975af2c49baceb473c4b1ace2c108b00.zip tk-a76a88dd975af2c49baceb473c4b1ace2c108b00.tar.gz tk-a76a88dd975af2c49baceb473c4b1ace2c108b00.tar.bz2 |
font measurement fix
Diffstat (limited to 'tests/textDisp.test')
-rw-r--r-- | tests/textDisp.test | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/textDisp.test b/tests/textDisp.test index 31abdd1..7f1a54a 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: textDisp.test,v 1.22 2003/11/21 18:51:18 vincentdarley Exp $ +# RCS: @(#) $Id: textDisp.test,v 1.23 2003/12/04 12:10:07 vincentdarley Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -3579,6 +3579,29 @@ test textDisp-33.4 {one line longer than fits in the widget} { set result } {ok} destroy .tt +test textDisp-33.5 {bold or italic fonts} {winOnly} { + destroy .tt + pack [text .tt -wrap char -font {{MS Sans Serif} 15}] + font create no -family [lindex [.tt cget -font] 0] -size 24 + font create bi -family [lindex [.tt cget -font] 0] -size 24 + font configure bi -weight bold -slant italic + .tt tag configure bi -font bi + .tt tag configure no -font no + .tt insert end abcd no efgh bi ijkl\n no + update + set bb {} + for {set i 0} {$i < 12} {incr i 4} { + lappend bb [lindex [.tt bbox 1.$i] 0] + } + foreach {a b c} $bb {} + unset bb + if {($b - $a) * 1.5 < ($c - $b)} { + set result "italic font has much too much space" + } else { + set result "italic font measurement ok" + } +} {italic font measurement ok} +destroy .tt deleteWindows option clear |