>From: Hans-Christoph Steiner <hans@at.or.at>
>To: pd-dev@iem.at
>Sent: Tuesday, June 18, 2013 1:39 PM
>Subject: Re: [PD-dev] remove tk scaling


>In general, removing bits of code willy-nilly is a bad idea.

Agreed.  Now let's talk about this specific case.

> 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.

And those tweaks (read: using pixel font sizes) give pixel exact results across
OSX, Windows, and Debian, _regardless_ of what value is set for tk scaling.

[tk scaling 1] is what leads to the tiny font problem on Windows.

> 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.

Sorry: I tested patch pixel-exactness on all platforms and only the canvas demo
below in Debian.  [tk scaling] for "point-sized" fonts (i.e., non-negative values)
in Windows will affect canvas text items, but not "pixel-sized" text items, which
AFAICT is everything in Pd.

I've tested with a) long comments, b) iemguis and their labels, and c) normal
object and message boxes.  All the above are pixel-exact across OSX, Windows,
GNU/Linux regardless of tk scaling value.

>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.

As I pointed out below, "point-sized" fonts (i.e., non-negative) aren't affected
by [tk scaling n] on Debian (X11), so using [tk scaling n] to get a zoomable interface
is not cross-platform and therefore isn't a possibility.

Also, note that the starting point for this was the tiny font bug that reappears every
time someone makes a gui-plugin or new dialog with a widget that didn't get caught
by one of the many [option add etc.] statements that are there to correct the bug
caused by [tk scaling 1].

-Jonathan

.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@iem.at
>> http://lists.puredata.info/listinfo/pd-dev
>
>
> _______________________________________________
> Pd-dev mailing list
> Pd-dev@iem.at
> http://lists.puredata.info/listinfo/pd-dev
>

_______________________________________________
Pd-dev mailing list
Pd-dev@iem.at
http://lists.puredata.info/listinfo/pd-dev