--- tests/textDisp.test
+++ tests/textDisp.test
@@ -67,10 +67,18 @@
 text .t -font $fixedFont -width 20 -height 10 -yscrollcommand scroll
 pack .t -expand 1 -fill both
 .t tag configure big -font $bigFont
 .t debug on
 wm geometry . {}
+
+set padx [lindex [.t configure -padx] 4]
+incr padx [lindex [.t configure -highlightthickness] 4]
+set borderwidth [lindex [.t configure -borderwidth] 4]
+incr padx $borderwidth
+set pady [lindex [.t configure -pady] 4]
+incr pady [lindex [.t configure -highlightthickness] 4]
+incr pady $borderwidth

 # The statements below reset the main window;  it's needed if the window
 # manager is mwm to make mwm forget about a previous minimum size setting.

 wm withdraw .
@@ -205,13 +213,14 @@
     lappend x [lindex [.t bbox 1.2] 0]
     .t tag configure z -tabs {30}
     .t tag raise x
     update idletasks
     lappend x [lindex [.t bbox 1.2] 0]
-} [list 75 55 55]
+} [list [expr {70+$padx}] [expr {50+$padx}] [expr {50+$padx}]]
 .t tag delete x y z
-test textDisp-1.2 {GetStyle procedure, wrapmode} {textfonts} {
+
+test textDisp-1.2 {GetStyle procedure, wrapmode} {
     .t configure -wrap char
     .t delete 1.0 end
     .t insert 1.0 "abcd\nefg hijkl mnop qrstuv wxyz"
     .t tag configure x -wrap word
     .t tag configure y -wrap none
@@ -220,152 +229,223 @@
     set result [list [.t bbox 2.20]]
     .t tag add x 2.0 2.1
     lappend result [.t bbox 2.20]
     .t tag add y 1.end 2.2
     lappend result [.t bbox 2.20]
-} [list [list 5 [expr {5+2*$fixedHeight}] 7 $fixedHeight] [list 40 [expr {5+2*$fixedHeight}] 7 $fixedHeight] {}]
+} [list \
+    [list $padx [expr {$pady+2*$fixedHeight}] $fixedWidth $fixedHeight] \
+    [list [expr {$padx+5*$fixedWidth}] [expr {$pady+2*$fixedHeight}] $fixedWidth $fixedHeight] \
+    {}]
 .t tag delete x y

 test textDisp-2.1 {LayoutDLine, basics} {
     .t configure -wrap char
     .t delete 1.0 end
     .t insert 1.0 "This is some sample text for testing."
     list [.t bbox 1.19] [.t bbox 1.20]
-} [list [list [expr 5 + $fixedWidth * 19] 5 $fixedWidth $fixedHeight] [list 5 [expr 5 + $fixedHeight] $fixedWidth $fixedHeight]]
-test textDisp-2.2 {LayoutDLine, basics} {textfonts} {
+} [list \
+    [list [expr $padx + $fixedWidth * 19] $pady $fixedWidth $fixedHeight] \
+    [list $padx [expr $padx + $fixedHeight] $fixedWidth $fixedHeight]]
+
+test textDisp-2.2 {LayoutDLine, basics} {
     .t configure -wrap char
     .t delete 1.0 end
     .t insert 1.0 "This isx some sample text for testing."
     list [.t bbox 1.19] [.t bbox 1.20]
-} [list [list 138 5 7 $fixedHeight] [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight]]
-test textDisp-2.3 {LayoutDLine, basics} {textfonts} {
+} [list \
+    [list [expr {$padx+19*$fixedWidth}] $pady $fixedWidth $fixedHeight] \
+    [list $padx [expr {$pady+$fixedHeight}] $fixedWidth $fixedHeight]]
+
+test textDisp-2.3 {LayoutDLine, basics} {
     .t configure -wrap char
     .t delete 1.0 end
     .t insert 1.0 "This isxxx some sample text for testing."
     list [.t bbox 1.19] [.t bbox 1.20]
-} [list [list 138 5 7 $fixedHeight] [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight]]
-test textDisp-2.4 {LayoutDLine, word wrap} {textfonts} {
+} [list \
+    [list [expr {$padx+19*$fixedWidth}] $pady $fixedWidth $fixedHeight] \
+    [list $padx [expr {$pady+$fixedHeight}] $fixedWidth $fixedHeight]]
+
+test textDisp-2.4 {LayoutDLine, word wrap} {
     .t configure -wrap word
     .t delete 1.0 end
     .t insert 1.0 "This is some sample text for testing."
     list [.t bbox 1.19] [.t bbox 1.20]
-} [list [list 138 5 7 $fixedHeight] [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight]]
-test textDisp-2.5 {LayoutDLine, word wrap} {textfonts} {
+} [list \
+    [list [expr {$padx+19*$fixedWidth}] $pady $fixedWidth $fixedHeight] \
+    [list $padx [expr {$pady+$fixedHeight}] $fixedWidth $fixedHeight]]
+
+test textDisp-2.5 {LayoutDLine, word wrap} {
     .t configure -wrap word
     .t delete 1.0 end
     .t insert 1.0 "This isx some sample text for testing."
     list [.t bbox 1.13] [.t bbox 1.19] [.t bbox 1.20] [.t bbox 1.21]
-} [list [list 96 5 $fixedWidth $fixedHeight] [list 138 5 $fixedWidth $fixedHeight] [list 145 5 0  $fixedHeight] [list 5 [expr {$fixedDiff + 18}] $fixedWidth $fixedHeight]]
+} [list \
+    [list [expr {$padx+13*$fixedWidth}] $pady $fixedWidth $fixedHeight] \
+    [list [expr {$padx+19*$fixedWidth}] $pady $fixedWidth $fixedHeight] \
+    [list [expr {$padx+20*$fixedWidth}] $pady 0 $fixedHeight] \
+    [list $padx [expr {$pady+$fixedHeight}] $fixedWidth $fixedHeight]]
+
 test textDisp-2.6 {LayoutDLine, word wrap} {
     .t configure -wrap word
     .t delete 1.0 end
     .t insert 1.0 "This isxxx some sample text for testing."
     list [.t bbox 1.15] [.t bbox 1.16]
-} [list [list 110 5 35 $fixedHeight] [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight]]
-test textDisp-2.7 {LayoutDLine, marks and tags} {textfonts} {
+} [list \
+    [list [expr {$padx+15*$fixedWidth}] $pady [expr {5*$fixedWidth}] $fixedHeight] \
+    [list $padx [expr {$pady+$fixedHeight}] $fixedWidth $fixedHeight]]
+
+test textDisp-2.7 {LayoutDLine, marks and tags} {
     .t configure -wrap word
     .t delete 1.0 end
     .t insert 1.0 "This isxxx some sample text for testing."
     .t tag add foo 1.4 1.6
     .t mark set insert 1.8
     list [.t bbox 1.2] [.t bbox 1.5] [.t bbox 1.11]
-} [list [list 19 5 7 $fixedHeight] [list 40 5 7 $fixedHeight] [list 82 5 7 $fixedHeight]]
+} [list \
+    [list [expr {$padx+2*$fixedWidth}] $pady $fixedWidth $fixedHeight] \
+    [list [expr {$padx+5*$fixedWidth}] $pady $fixedWidth $fixedHeight] \
+    [list [expr {$padx+11*$fixedWidth}] $pady $fixedWidth $fixedHeight]]
 foreach m [.t mark names] {
     catch {.t mark unset $m}
 }
 scan [wm geom .] %dx%d width height
-test textDisp-2.8 {LayoutDLine, extra chunk at end of dline} {textfonts} {
+
+test textDisp-2.8 {LayoutDLine, extra chunk at end of dline} {
     wm geom . [expr $width+1]x$height
     update
     .t configure -wrap char
     .t delete 1.0 end
     .t insert 1.0 "This isxx some sample text for testing."
     .t mark set foo 1.20
     list [.t bbox 1.19] [.t bbox 1.20]
-} [list [list 138 5 8 $fixedHeight] [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight]]
+} [list \
+    [list [expr {$padx+19*$fixedWidth}] $pady [expr {$fixedWidth+1}] $fixedHeight] \
+    [list $padx [expr {$pady+$fixedHeight}] $fixedWidth $fixedHeight]]
 wm geom . {}
 update
-test textDisp-2.9 {LayoutDLine, marks and tags} {textfonts} {
+
+test textDisp-2.9 {LayoutDLine, marks and tags} {
     .t configure -wrap word
     .t delete 1.0 end
     .t insert 1.0 "This is a very_very_long_word_that_wraps."
     list [.t bbox 1.9] [.t bbox 1.10] [.t bbox 1.25]
-} [list [list 68 5 77 $fixedHeight] [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 110 [expr {$fixedDiff + 18}] 7 $fixedHeight]]
-test textDisp-2.10 {LayoutDLine, marks and tags} {textfonts} {
+} [list \
+    [list [expr {$padx+9*$fixedWidth}] $pady [expr {11*$fixedWidth}] $fixedHeight] \
+    [list $padx [expr {$pady+$fixedHeight}] $fixedWidth $fixedHeight] \
+    [list [expr {$padx+15*$fixedWidth}] [expr {$pady+$fixedHeight}] $fixedWidth $fixedHeight]]
+
+test textDisp-2.10 {LayoutDLine, marks and tags} {
     .t configure -wrap word
     .t delete 1.0 end
     .t insert 1.0 "This is a very_very_long_word_that_wraps."
     .t tag add foo 1.13
     .t tag add foo 1.15
     .t tag add foo 1.17
     .t tag add foo 1.19
     list [.t bbox 1.9] [.t bbox 1.10] [.t bbox 1.25]
-} [list [list 68 5 77 $fixedHeight] [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 110 [expr {$fixedDiff + 18}] 7 $fixedHeight]]
-test textDisp-2.11 {LayoutDLine, newline width} {textfonts} {
+} [list \
+    [list [expr {$padx+9*$fixedWidth}] $pady [expr {11*$fixedWidth}] $fixedHeight] \
+    [list $padx [expr {$pady+$fixedHeight}] $fixedWidth $fixedHeight] \
+    [list [expr {$padx+15*$fixedWidth}] [expr {$pady+$fixedHeight}] $fixedWidth $fixedHeight]]
+
+test textDisp-2.11 {LayoutDLine, newline width} {
     .t configure -wrap char
     .t delete 1.0 end
     .t insert 1.0 "a\nbb\nccc\ndddd"
     list [.t bbox 2.2] [.t bbox 3.3]
-} [list [list 19 [expr {$fixedDiff + 18}] 126 $fixedHeight] [list 26 [expr {2*$fixedDiff + 31}] 119 $fixedHeight]]
-test textDisp-2.12 {LayoutDLine, justification} {textfonts} {
+} [list \
+    [list [expr {$padx+2*$fixedWidth}] [expr {$pady+$fixedHeight}] [expr {18*$fixedWidth}] $fixedHeight] \
+    [list [expr {$padx+3*$fixedWidth}] [expr {$pady+2*$fixedHeight}] [expr {17*$fixedWidth}] $fixedHeight]]
+
+test textDisp-2.12 {LayoutDLine, justification} {
     .t configure -wrap char
     .t delete 1.0 end
     .t insert 1.0 "\na\nbb\nccc\ndddd"
     .t tag configure x -justify center
     .t tag add x 1.0 end
     .t tag add y 3.0 3.2
     list [.t bbox 1.0] [.t bbox 2.0] [.t bbox 4.0] [.t bbox 4.2]
-} [list [list 75 5 70 $fixedHeight] [list 71 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 64 [expr {3*$fixedDiff + 44}] 7 $fixedHeight] [list 78 [expr {3*$fixedDiff + 44}] 7 $fixedHeight]]
-test textDisp-2.13 {LayoutDLine, justification} {textfonts} {
+} [list \
+    [list [expr {$padx+round(((20.0)*$fixedWidth)/2.0)}] $pady [expr {10*$fixedWidth}] $fixedHeight] \
+    [list [expr {$padx+round(((20.0-1.0)*$fixedWidth)/2.0)-1}] [expr {$pady+$fixedHeight}] $fixedWidth $fixedHeight] \
+    [list [expr {$padx+round(((20.0-3.0)*$fixedWidth)/2.0)-1}] [expr {$pady+3*$fixedHeight}] $fixedWidth $fixedHeight] \
+    [list [expr {$padx+round(((20.0-3.0)*$fixedWidth)/2.0)+2*$fixedWidth-1}] [expr {$pady+3*$fixedHeight}] $fixedWidth $fixedHeight]]
+
+test textDisp-2.13 {LayoutDLine, justification} {
     .t configure -wrap char
     .t delete 1.0 end
     .t insert 1.0 "\na\nbb\nccc\ndddd"
     .t tag configure x -justify right
     .t tag add x 1.0 end
     .t tag add y 3.0 3.2
     list [.t bbox 1.0] [.t bbox 2.0] [.t bbox 4.0] [.t bbox 4.2]
-} [list [list 145 5 0 $fixedHeight] [list 138 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 124 [expr {3*$fixedDiff + 44}] 7 $fixedHeight] [list 138 [expr {3*$fixedDiff + 44}] 7 $fixedHeight]]
-test textDisp-2.14 {LayoutDLine, justification} {textfonts} {
+} [list \
+    [list [expr {$padx+20*$fixedWidth}] $pady 0 $fixedHeight] \
+    [list [expr {$padx+19*$fixedWidth}] [expr {$pady+$fixedHeight}] $fixedWidth $fixedHeight] \
+    [list [expr {$padx+17*$fixedWidth}] [expr {$pady+3*$fixedHeight}] $fixedWidth $fixedHeight] \
+    [list [expr {$padx+19*$fixedWidth}] [expr {$pady+3*$fixedHeight}] $fixedWidth $fixedHeight]]
+
+test textDisp-2.14 {LayoutDLine, justification} {
     .t configure -wrap char
     .t delete 1.0 end
     .t insert 1.0 "\na\nbb\nccc\ndddd"
     .t tag configure x -justify center
     .t tag add x 2.0 3.1
     .t tag configure y -justify right
     .t tag add y 3.0 4.0
     .t tag raise y
     list [.t bbox 2.0] [.t bbox 3.0] [.t bbox 3.end] [.t bbox 4.0]
-} [list [list 71 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 131 [expr {2*$fixedDiff + 31}] 7 $fixedHeight] [list 145 [expr {2*$fixedDiff + 31}] 0 $fixedHeight] [list 5 [expr {3*$fixedDiff + 44}] 7 $fixedHeight]]
-test textDisp-2.15 {LayoutDLine, justification} {textfonts} {
+} [list \
+    [list [expr {$padx+round(((20.0-1.0)*$fixedWidth)/2.0)-1}] [expr {$pady+$fixedHeight}] $fixedWidth $fixedHeight] \
+    [list [expr {$padx+18*$fixedWidth}] [expr {$pady+2*$fixedHeight}] $fixedWidth $fixedHeight] \
+    [list [expr {$padx+20*$fixedWidth}] [expr {$pady+2*$fixedHeight}] 0 $fixedHeight] \
+    [list $padx [expr {$pady+3*$fixedHeight}] $fixedWidth $fixedHeight]]
+
+test textDisp-2.15 {LayoutDLine, justification} {
     .t configure -wrap char
     .t delete 1.0 end
     .t insert 1.0 "\na\nbb\nccc\ndddd"
     .t tag configure x -justify center
     .t tag add x 2.0 3.1
     .t tag configure y -justify right
     .t tag add y 3.0 4.0
     .t tag lower y
     list [.t bbox 2.0] [.t bbox 3.0] [.t bbox 3.end] [.t bbox 4.0]
-} [list [list 71 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 68 [expr {2*$fixedDiff + 31}] 7 $fixedHeight] [list 82 [expr {2*$fixedDiff + 31}] 63 $fixedHeight] [list 5 [expr {3*$fixedDiff + 44}] 7 $fixedHeight]]
-test textDisp-2.16 {LayoutDLine, justification} {textfonts} {
+} [list \
+    [list [expr {$padx+round(((20.0-1.0)*$fixedWidth)/2.0)-1}] [expr {$pady+$fixedHeight}] $fixedWidth $fixedHeight] \
+    [list [expr {$padx+round(((20.0-2.0)*$fixedWidth)/2.0)}] [expr {$pady+2*$fixedHeight}] $fixedWidth $fixedHeight] \
+    [list [expr {$padx+round(((20.0-2.0)*$fixedWidth)/2.0)+2*$fixedWidth}] [expr {$pady+2*$fixedHeight}] [expr {9*$fixedWidth}] $fixedHeight] \
+    [list $padx [expr {$pady+3*$fixedHeight}] $fixedWidth $fixedHeight]]
+
+test textDisp-2.16 {LayoutDLine, justification} {
     .t configure -wrap word
     .t delete 1.0 end
     .t insert 1.0 "Lots of long words, enough to force word wrap\nThen\nmore lines"
     .t tag configure x -justify center
     .t tag add x 1.1 1.20
     .t tag add x 1.21 1.end
     list [.t bbox 1.0] [.t bbox 1.20] [.t bbox 1.41] [.t bbox 2.0]
-} [list [list 5 5 7 $fixedHeight] [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 61 [expr {2*$fixedDiff + 31}] 7 $fixedHeight] [list 5 [expr {3*$fixedDiff + 44}] 7 $fixedHeight]]
-test textDisp-2.17 {LayoutDLine, justification} {textfonts} {
+} [list \
+    [list $padx $pady $fixedWidth $fixedHeight] \
+    [list $padx [expr {$pady+$fixedHeight}] $fixedWidth $fixedHeight] \
+    [list [expr {$padx+8*$fixedWidth}] [expr {$pady+2*$fixedHeight}] $fixedWidth $fixedHeight] \
+    [list $padx [expr {$pady+3*$fixedHeight}] $fixedWidth $fixedHeight]]
+
+test textDisp-2.17 {LayoutDLine, justification} {
     .t configure -wrap word
     .t delete 1.0 end
     .t insert 1.0 "Lots of very long words, enough to force word wrap\nThen\nmore lines"
     .t tag configure x -justify center
     .t tag add x 1.18
     list [.t bbox 1.0] [.t bbox 1.18] [.t bbox 1.35] [.t bbox 2.0]
-} [list [list 5 5 7 $fixedHeight] [list 15 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 5 [expr {2*$fixedDiff + 31}] 7 $fixedHeight] [list 5 [expr {3*$fixedDiff + 44}] 7 $fixedHeight]]
-test textDisp-2.18 {LayoutDLine, justification} {textfonts} {
+} [list \
+    [list $padx $pady $fixedWidth $fixedHeight] \
+    [list [expr {$padx+round(((20.0-17.0)*$fixedWidth)/2.0)-1}] [expr {$pady+$fixedHeight}] $fixedWidth $fixedHeight] \
+    [list $padx [expr {$pady+2*$fixedHeight}] $fixedWidth $fixedHeight] \
+    [list $padx [expr {$pady+3*$fixedHeight}] $fixedWidth $fixedHeight]]
+
+test textDisp-2.18 {LayoutDLine, justification} {
     .t configure -wrap none
     .t delete 1.0 end
     .t insert 1.0 "Lots of long words, enough to extend out of the window\n"
     .t insert end "Then\nmore lines\nThat are shorter"
     .t tag configure x -justify center
@@ -372,43 +452,60 @@
     .t tag configure y -justify right
     .t tag add x 2.0
     .t tag add y 3.0
     .t xview scroll 5 units
     list [.t bbox 2.0] [.t bbox 3.0]
-} [list [list 26 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 40 [expr {2*$fixedDiff + 31}] 7 $fixedHeight]]
+} [list \
+    [list [expr {$padx+round(((20.0-4.0)*$fixedWidth)/2.0)-5*$fixedWidth}] [expr {$pady+$fixedHeight}] $fixedWidth $fixedHeight] \
+    [list [expr {$padx+5*$fixedWidth}] [expr {$pady+2*$fixedHeight}] $fixedWidth $fixedHeight]]
 .t tag delete x
 .t tag delete y
-test textDisp-2.19 {LayoutDLine, margins} {textfonts} {
+
+test textDisp-2.19 {LayoutDLine, margins} {
     .t configure -wrap word
     .t delete 1.0 end
     .t insert 1.0 "Lots of long words, enough to force word wrap\nThen\nmore lines"
     .t tag configure x -lmargin1 20 -lmargin2 40 -rmargin 15
     .t tag add x 1.0 end
     list [.t bbox 1.0] [.t bbox 1.12] [.t bbox 1.13] [.t bbox 2.0]
-} [list [list 25 5 7 $fixedHeight] [list 109 5 36 $fixedHeight] [list 45 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 25 [expr {5*$fixedDiff + 70}] 7 $fixedHeight]]
-test textDisp-2.20 {LayoutDLine, margins} {textfonts} {
+} [list \
+    [list [expr {$padx+20}] $pady $fixedWidth $fixedHeight] \
+    [list [expr {$padx+20+12*$fixedWidth}] $pady [expr {5*$fixedWidth+1}] $fixedHeight] \
+    [list [expr {$padx+40}] [expr {$pady+$fixedHeight}] $fixedWidth $fixedHeight] \
+    [list [expr {$padx+20}] [expr {$pady+5*$fixedHeight}] $fixedWidth $fixedHeight]]
+
+test textDisp-2.20 {LayoutDLine, margins} {
     .t configure -wrap word
     .t delete 1.0 end
     .t insert 1.0 "Lots of long words, enough to force word wrap\nThen\nmore lines"
     .t tag configure x -lmargin1 20 -lmargin2 10 -rmargin 3
     .t tag configure y -lmargin1 15 -lmargin2 5 -rmargin 0
     .t tag raise y
     .t tag add x 1.0 end
     .t tag add y 1.13
     list [.t bbox 1.0] [.t bbox 1.13] [.t bbox 1.30] [.t bbox 2.0]
-} [list [list 25 5 7 $fixedHeight] [list 10 [expr {$fixedDiff + 18}] 7 $fixedHeight] [list 15 [expr {2*$fixedDiff + 31}] 7 $fixedHeight] [list 25 [expr {3*$fixedDiff + 44}] 7 $fixedHeight]]
-test textDisp-2.21 {LayoutDLine, margins} {textfonts} {
+} [list \
+    [list [expr {$padx+20}] $pady $fixedWidth $fixedHeight] \
+    [list [expr {$padx+5}] [expr {$pady+$fixedHeight}] $fixedWidth $fixedHeight] \
+    [list [expr {$padx+10}] [expr {$pady+2*$fixedHeight}] $fixedWidth $fixedHeight] \
+    [list [expr {$padx+20}] [expr {$pady+3*$fixedHeight}] $fixedWidth $fixedHeight]]
+
+test textDisp-2.21 {LayoutDLine, margins} {
     .t configure -wrap word
     .t delete 1.0 end
     .t insert 1.0 "Sample text"
     .t tag configure x -lmargin1 80 -lmargin2 80 -rmargin 100
     .t tag add x 1.0 end
     list [.t bbox 1.0] [.t bbox 1.1] [.t bbox 1.2]
-} [list [list 85 5 60 $fixedHeight] [list 85 [expr {$fixedDiff + 18}] 60 $fixedHeight] [list 85 [expr {2*$fixedDiff + 31}] 60 $fixedHeight]]
+} [list \
+    [list [expr {$padx+80}] $pady [expr {round(((20.0-1.0)*$fixedWidth)*0.444)+1}] $fixedHeight] \
+    [list [expr {$padx+80}] [expr {$pady+$fixedHeight}] [expr {round(((20.0-1.0)*$fixedWidth)*0.444)+1}] $fixedHeight] \
+    [list [expr {$padx+80}] [expr {$pady+2*$fixedHeight}] [expr {round(((20.0-1.0)*$fixedWidth)*0.444)+1}] $fixedHeight]]
 .t tag delete x
 .t tag delete y
-test textDisp-2.22 {LayoutDLine, spacing options} {textfonts} {
+
+test textDisp-2.22 {LayoutDLine, spacing options} {
     .t configure -wrap word
     .t delete 1.0 end
     .t tag delete x y
     .t insert end "Short line\nLine 2 is long enough "
     .t insert end "to wrap around a couple of times"
@@ -431,11 +528,12 @@
     set i [.t dlineinfo 3.0]
     set b4 [expr [lindex $i 1] + [lindex $i 4] - $b4]
     list $b1 $b2 $b3 $b4
 } [list 2 7 10 15]
 .t configure -spacing1 0 -spacing2 0 -spacing3 0
-test textDisp-2.23 {LayoutDLine, spacing options} {textfonts} {
+
+test textDisp-2.23 {LayoutDLine, spacing options} {
     .t configure -wrap word
     .t delete 1.0 end
     .t tag delete x y
     .t insert end "Short line\nLine 2 is long enough "
     .t insert end "to wrap around a couple of times"
@@ -463,31 +561,34 @@
     set i [.t dlineinfo 3.0]
     set b4 [expr [lindex $i 1] + [lindex $i 4] - $b4]
     list $b1 $b2 $b3 $b4
 } [list 1 5 13 16]
 .t configure -spacing1 0 -spacing2 0 -spacing3 0
-test textDisp-2.24 {LayoutDLine, tabs, saving from first chunk} {textfonts} {
+
+test textDisp-2.24 {LayoutDLine, tabs, saving from first chunk} {
     .t delete 1.0 end
     .t tag delete x y
     .t tag configure x -tabs 70
     .t tag configure y -tabs 80
     .t insert 1.0 "ab\tcde"
     .t tag add x 1.0 end
     .t tag add y 1.1 end
     lindex [.t bbox 1.3] 0
-} {75}
-test textDisp-2.25 {LayoutDLine, tabs, breaking chunks at tabs} {textfonts} {
+} [expr {$padx+70}]
+
+test textDisp-2.25 {LayoutDLine, tabs, breaking chunks at tabs} {
     .t delete 1.0 end
     .t tag delete x
     .t tag configure x -tabs [list 30 60 90 120]
     .t insert 1.0 "a\tb\tc\td\te"
     .t mark set dummy1 1.1
     .t mark set dummy2 1.2
     .t tag add x 1.0 end
     list [lindex [.t bbox 1.2] 0] [lindex [.t bbox 1.4] 0] \
 	    [lindex [.t bbox 1.6] 0] [lindex [.t bbox 1.8] 0]
-} [list 35 65 95 125]
+} [list [expr {$padx+30}] [expr {$padx+60}] [expr {$padx+90}] [expr {$padx+120}]]
+
 test textDisp-2.26 {LayoutDLine, tabs, breaking chunks at tabs} {textfonts} {
     .t delete 1.0 end
     .t tag delete x
     .t tag configure x -tabs [list 30 60 90 120] -justify right
     .t insert 1.0 "a\tb\tc\td\te"
@@ -495,33 +596,37 @@
     .t mark set dummy2 1.2
     .t tag add x 1.0 end
     list [lindex [.t bbox 1.2] 0] [lindex [.t bbox 1.4] 0] \
 	    [lindex [.t bbox 1.6] 0] [lindex [.t bbox 1.8] 0]
 } [list 117 124 131 138]
-test textDisp-2.27 {LayoutDLine, tabs, calling AdjustForTab} {textfonts} {
+
+test textDisp-2.27 {LayoutDLine, tabs, calling AdjustForTab} {
     .t delete 1.0 end
     .t tag delete x
     .t tag configure x -tabs [list 30 60]
     .t insert 1.0 "a\tb\tcd"
     .t tag add x 1.0 end
     list [lindex [.t bbox 1.2] 0] [lindex [.t bbox 1.4] 0]
-} [list 35 65]
-test textDisp-2.28 {LayoutDLine, tabs, running out of space in dline} {textfonts} {
+} [list [expr {$padx+30}] [expr {$padx+60}]]
+
+test textDisp-2.28 {LayoutDLine, tabs, running out of space in dline} {
     .t delete 1.0 end
     .t insert 1.0 "a\tb\tc\td"
     .t bbox 1.6
-} [list 5 [expr {$fixedDiff + 18}] 7 $fixedHeight]
-test textDisp-2.29 {LayoutDLine, tabs, running out of space in dline} {textfonts} {
+} [list $padx [expr {$pady+$fixedHeight}] $fixedWidth $fixedHeight]
+
+test textDisp-2.29 {LayoutDLine, tabs, running out of space in dline} {
     .t delete 1.0 end
     .t insert 1.0 "a\tx\tabcd"
     .t bbox 1.4
-} [list 117 5 7 $fixedHeight]
-test textDisp-2.30 {LayoutDLine, tabs, running out of space in dline} {textfonts} {
+} [list [expr {$padx+16*$fixedWidth}] $pady $fixedWidth $fixedHeight]
+
+test textDisp-2.30 {LayoutDLine, tabs, running out of space in dline} {
     .t delete 1.0 end
     .t insert 1.0 "a\tx\tabc"
     .t bbox 1.4
-} [list 117 5 7 $fixedHeight]
+} [list [expr {$padx+16*$fixedWidth}] $pady $fixedWidth $fixedHeight]

 test textDisp-3.1 {different character sizes} {textfonts} {
     .t configure -wrap word
     .t delete 1.0 end
     .t insert end "Some sample text, including both large\n"
