From 9d9cee0288f4ef2d88ddaa3a3f41c34751d851fd Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 1 Dec 2016 19:27:08 +0000 Subject: Also the fact that the actually used fonts must be fixed-width needs to be checked when assessing the value of the haveFontSizes constraint --- tests/textTag.test | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/textTag.test b/tests/textTag.test index a2b2d73..6489c3a 100644 --- a/tests/textTag.test +++ b/tests/textTag.test @@ -12,16 +12,18 @@ eval tcltest::configure $argv tcltest::loadTestedCommands set textWidgetFont {Courier 12} -set bigFont {Helvetica 24} +set bigFont {Courier 24} -# what is needed is a specific font *size* because in some tests (that -# will be constrained by haveFontSizes), a tag applying the $bigFont -# will be set to some characters, which action has the effect of -# changing what character is under the mouse pointer, which is the -# purpose of the tests +# what is needed is a font that is both fixed-width and featuring a +# specific size because in some tests (that will be constrained by +# haveFontSizes), a tag applying the $bigFont will be set to some +# characters, which action has the effect of changing what character +# is under the mouse pointer, which is the purpose of the tests testConstraint haveFontSizes [expr { - [font actual $textWidgetFont -size] == 12 && - [font actual $bigFont -size] == 24 } + [font metrics $textWidgetFont -fixed] && + [font actual $textWidgetFont -size] == 12 && + [font metrics $bigFont -fixed] && + [font actual $bigFont -size] == 24 } ] destroy .t -- cgit v0.12