[PD-dev] remove tk scaling

Jonathan Wilkes jancsika at yahoo.com
Wed Jun 12 03:11:57 CEST 2013


Hi list,

From tcl/pd-gui:
    # we are not using Tk scaling, so fix it to 1 on all platforms.  This
    # guarantees that patches will be pixel-exact on every platform
    tk scaling 1

From #tcl on freenode:
<jancsika> hello. does tk scaling affect canvas items?
<ijchain> <emiliano> jancsika: no

From my own experiments on Debian:
* setting the tk scaling to 1, 0.2, 3, or 200 does not alter
a canvas text item, either for positive (pointsize) font sizes
or negative (pixelsize) font sizes
* with version 8.5.11, setting tk scaling to 1, 0.2, 3, or 200
_will_ change the actual number of pixels a canvas requests
from its parent _if_ you pack it without any option flags.
(e.g., scaling at 0.2 will request a tiny rectangle and scaling
at 200 will be bigger than the visible screen area, at least on
my laptop).  However, Pd packs its canvas items to fill the
cavity provided by the toplevel parent (which always has
its geometry set explicitly), so no matter what tk scaling value
you set the canvas will be exactly the right size.

You can check this by setting tk scaling to any value at all.
The tk widgets will of course look different (that's what tk
scaling affects, after all), but just click <ctrl-n> for a new
patch and it will look exactly right.  Also try:

[label foo(
|
[vsl]

... and you will find that even iemguis have _exactly_ the
same font size no matter what you provided for tk scaling.

Effect of [tk scaling 1] command:
causes tiny fonts in various widgets on Windows, which then
requires a dev to fire up Pd on a Windows machine and
screw around with the options database until they find the
correct string to set the menufont

Side effect: if you want to embed tk widgets in a patch, not
having tk scaling frozen at "1" may end up making those widgets
have different sizes on different platforms.  But even with
[tk scaling 1] you cannot guarantee pixel-exactness in this case,
because tk uses native widgets from the OS, and different OSes
will request different padding, font-sizes, images, etc. for those
widgets.

So-- is there any reason not to remove "tk scaling 1"?

Thanks,
Jonathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20130611/ff397e3c/attachment.htm>


More information about the Pd-dev mailing list