summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorhobbs <hobbs>2004-02-14 01:54:48 (GMT)
committerhobbs <hobbs>2004-02-14 01:54:48 (GMT)
commit49243c32805b045b05c426b281ca7003ec6b9e50 (patch)
tree64bd32da19166bde7867af7765914e17e0fc393a /tests
parentcd189fc9bb34dea269ec4880dc736ebe93f6c5bf (diff)
downloadtk-49243c32805b045b05c426b281ca7003ec6b9e50.zip
tk-49243c32805b045b05c426b281ca7003ec6b9e50.tar.gz
tk-49243c32805b045b05c426b281ca7003ec6b9e50.tar.bz2
* win/tkWinFont.c (Tk_MeasureChars): backport fixes to bold/italic
font handling. [Patch 852669] [Bug 478568] * tests/textDisp.test: added test for the font measurement problem.
Diffstat (limited to 'tests')
-rw-r--r--tests/textDisp.test26
1 files changed, 25 insertions, 1 deletions
diff --git a/tests/textDisp.test b/tests/textDisp.test
index 14b3b4a..aa0bdef 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.8 2002/11/22 23:25:20 hobbs Exp $
+# RCS: @(#) $Id: textDisp.test,v 1.8.2.1 2004/02/14 01:54:49 hobbs Exp $
package require tcltest 2.1
namespace import -force tcltest::configure
@@ -2869,6 +2869,30 @@ test textDisp-29.3 {miscellaneous: lines wrap but are still too long} {fonts} {
list [.t2.t xview] [winfo geom .t2.t.f] [.t2.t bbox 1.3]
} {{0.536667 1} 300x50+-156+18 {}}
+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