MGS - Dynamically changing the
tk scaling value does not seem to affect existing widgets or fonts. However, you can 'update' named fonts by doing:
foreach font [font names] {
font configure $font {*}[font actual $font]
}
Bryan Oakley 07-Jul-2005 The above doesn't work for fonts configured in pixel sizes. The problem is, 'font actual' returns a size in points rather than pixels no matter how the font is defined. Thus, any fonts defined as pixel sizes will be redefined based on points and will likely change size. Since the font was originally defined to be N pixels, it seems reasonable one would want the font to remain at N pixels even if the scaling factor changes.
I think the following code is a better solution, unless there is some reason for using
font actual rather than
font configure that I'm just not seeing... (and I also don't see why anything other than the size needs to be reconfigured...)
foreach font [font names] {
font configure $font -size [font configure $font -size]
}
MGS [2008-02-15]: Agreed - this code is much more sensible. I've just been trying it out under Tcl/Tk 8.5.0, and it seems that the 'tk scaling' value is ignored when creating/configuring named fonts. Bah.