Menu

#2935 fonts ignore tk scaling

obsolete: 8.5.10
open
5
2011-10-21
2011-10-21
No

Fonts appear to ignore the value of tk scaling:

Code:

puts "tk_patchLevel = $tk_patchLevel"
tk scaling 1
font create f -family helvetica -size 12
label .l -text "Hello World" -font f
update idletasks
puts "tk scaling = [tk scaling]"
puts "linespace (1) = [font metrics f -linespace]"
puts "winfo reqheight .l = [winfo reqheight .l]"
tk scaling 2
update idletasks
puts "tk scaling = [tk scaling]"
puts "linespace (2) = [font metrics f -linespace]"
puts "winfo reqheight .l = [winfo reqheight .l]"
font configure f -size 12
update idletasks
puts "linespace (3) = [font metrics f -linespace]"
puts "winfo reqheight .l = [winfo reqheight .l]"
exit 0

Output with 8.5.10/8.6b2:

tk_patchLevel = 8.6b2
tk scaling = 1.00028129395218
linespace (1) = 18
winfo reqheight .l = 22
tk scaling = 2.00056258790436
linespace (2) = 18
winfo reqheight .l = 22
linespace (3) = 18
winfo reqheight .l = 22

Output with 8.4.19:

tk_patchLevel = 8.4.19
tk scaling = 1.00028129395
linespace (1) = 12
winfo reqheight .l = 18
tk scaling = 2.0005625879
linespace (2) = 12
winfo reqheight .l = 18
linespace (3) = 27
winfo reqheight .l = 33

Tested on Linux (Ubuntu 11.10) with 8.5.10 and 8.6b2. Works as expected with 8.4.19 on Linux and with 8.6b2 on Windows XP. Not tested on Mac.

See also: http://wiki.tcl.tk/8488

Discussion

MongoDB Logo MongoDB