summaryrefslogtreecommitdiffstats
path: root/tests/textDisp.test
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2003-12-04 12:09:55 (GMT)
committervincentdarley <vincentdarley>2003-12-04 12:09:55 (GMT)
commit50c35588c1284033589929bdf168163d5f9f7a8d (patch)
tree9cff7de3afeb0dd3ffe36e6e86f94c00e27ad5e7 /tests/textDisp.test
parent5d9923f32aa62c0eb4d627f5c4b6898f61308a7b (diff)
downloadtk-50c35588c1284033589929bdf168163d5f9f7a8d.zip
tk-50c35588c1284033589929bdf168163d5f9f7a8d.tar.gz
tk-50c35588c1284033589929bdf168163d5f9f7a8d.tar.bz2
font measurement fix
Diffstat (limited to 'tests/textDisp.test')
-rw-r--r--tests/textDisp.test25
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