[PD-dev] remove tk scaling

Miller Puckette msp at ucsd.edu
Tue Jun 18 20:12:03 CEST 2013


What I've never understood is this: why wouldn't it suffice to 'unscale'
just the fonts Pd uses explicitly?  One can get an unscaled font by asking
for a size like -12 - then we wouldn't have to bash tk_scalaing globally
(thereby ruining font sizes in open dialogs and whatnot that Pd doesn't
depend on anyhow.)

(the relevant doc is in the "font" manual age for TK; "If size is
a negative number, its absolute value is interpreted as  a  size in pixels."

cheers
Miller

On Tue, Jun 18, 2013 at 01:39:30PM -0400, Hans-Christoph Steiner wrote:
> 
> In general, removing bits of code willy-nilly is a bad idea.  In this case, it
> took a ton of testing to get the right set of tweaks working across all
> platforms smoothly with the same pixel sizes on all platforms.  Given that you
> only tested on GNU/Linux, its a really bad idea to propose changes based only
> on one platform unless you are planning to drop support for all other platforms.
> 
> So follow what the comment there says: "This guarantees that patches will be
> pixel-exact on every platform".  If we had a pure Tcl/Tk GUI, then we could
> actually use tk scaling, and allow the user to adjust the tk scaling number,
> thereby having a zoomable interface.  That will require removing all GUI logic
> from the pd core and putting it only in the GUI.
> 
> .hc
> 
> On 06/12/2013 07:54 PM, Miller Puckette wrote:
> > Hi Jonathan et a -
> > 
> > I've never understood the reason tk_scaling is touched in the TK code and
> > unless someone else objects I'll try taking it out of the vanilla source.
> > 
> > thanks
> > Miller
> > 
> > On Tue, Jun 11, 2013 at 06:11:57PM -0700, Jonathan Wilkes wrote:
> >> 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
> > 
> >> _______________________________________________
> >> Pd-dev mailing list
> >> Pd-dev at iem.at
> >> http://lists.puredata.info/listinfo/pd-dev
> > 
> > 
> > _______________________________________________
> > Pd-dev mailing list
> > Pd-dev at iem.at
> > http://lists.puredata.info/listinfo/pd-dev
> > 
> 
> _______________________________________________
> Pd-dev mailing list
> Pd-dev at iem.at
> http://lists.puredata.info/listinfo/pd-dev



More information about the Pd-dev mailing list