diff options
author | vincentdarley <vincentdarley@noemail.net> | 2003-12-04 12:09:54 (GMT) |
---|---|---|
committer | vincentdarley <vincentdarley@noemail.net> | 2003-12-04 12:09:54 (GMT) |
commit | ab5e5c51ec7ee7de80706c44d5e1914e81f48523 (patch) | |
tree | 9cff7de3afeb0dd3ffe36e6e86f94c00e27ad5e7 /tests/textDisp.test | |
parent | 5cfda9e12794e9bcd264aa4d58450cc61d693e88 (diff) | |
download | tk-ab5e5c51ec7ee7de80706c44d5e1914e81f48523.zip tk-ab5e5c51ec7ee7de80706c44d5e1914e81f48523.tar.gz tk-ab5e5c51ec7ee7de80706c44d5e1914e81f48523.tar.bz2 |
font measurement fix
FossilOrigin-Name: 8d4352805895fcb58e1d0ac77235b2a971083fa7
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 |