[PD-dev] Status of GUI rewrite?

Jonathan Wilkes jancsika at yahoo.com
Mon Aug 22 19:28:24 CEST 2011


Current standard:
* all boxes have the same top-left origin
Current nonstandards:
* font size
* font face
* box length, thus ancillary xlet positions
* box height

So the only thing anyone can expect from the current behavior is that they can connect the left outlet of [foo] to the left inlet of [bar] and get a straight line that is straight across platforms.  Everything in a Pd diagram aside from iemgui polygons and left xlets is subject to random variation.

Since font size can _never_ be guaranteed to be pixel exact, Pd diagrams should hard code the box sizes so that they can be cross platform.  I've checked font metrics for "DejaVu Sans Mono" with the attached script on winxp and fedora at various DPI and screen resolutions, and the font-rendering variations I get are within a pixel.  So we could choose the largest values for the font's 

linespace and character width to virtually guarantee that, say, a size -12 "DejaVu Sans Mono" font will fit in the box on any platform.  In other words, the user chooses a box size instead of a font size.

This has the benefit of working with system fonts and custom fonts-- you just have a font init loop that increments the font size until it finds the largest size that fits in the hardcoded rectangle without overlapping it.  As a result, all straight line connections will remain straight lines-- in fact, the entire Pd diagram will be exact across platforms, save for font faces, or small variations in font size.

-Jonathan


>________________________________
>From: Hans-Christoph Steiner <hans at at.or.at>
>To: Stephen Lavelle <analytic at gmail.com>
>Cc: pd-dev List <pd-dev at iem.at>
>Sent: Monday, August 22, 2011 12:04 PM
>Subject: Re: [PD-dev] Status of GUI rewrite?
>
>
>On Aug 22, 2011, at 8:50 AM, Stephen Lavelle wrote:
>
>>> You can increase the font size which will make the boxes bigger.  Also, you might like the new inlet/outlet highlighting that's in Pd-extended 0.43 and pd-l2ork.  The inlets and outlets are tagged using Tk tags, so you should be able to change their size using the Tk canvas commands 'coords' or 'itemconfigure -width', etc.  I've never tried tho.
>>> Their hitboxes aren't though - canvas_doclick in g_editor.c has hard-coded numbers.
>> 
>> Arg, yes, that's true... sigh...  but I find the inlet/outlet highlighting helps a lot.
>> 
>> If I were to try make a patch, what do you think the appropriate place to expose it?  It feels like it would sit well beside the font size options...
>
>
>If you're modifying the C code, then I think the best approach would be to expose the settings in a way that people could change them via Tcl i.e. a GUI plugin.  Then people can play around with all sorts of behaviors. Its going to be the kind of thing where it'll be difficult to change the existing behavior because so many people expect it to work like that.  So it needs to be something customizable.
>
>.hc
>
>----------------------------------------------------------------------------
>
>Using ReBirth is like trying to play an 808 with a long stick.    -David Zicarelli
>
>
>
>_______________________________________________
>Pd-dev mailing list
>Pd-dev at iem.at
>http://lists.puredata.info/listinfo/pd-dev
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20110822/21dea3e5/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fontsize.tcl
Type: text/x-tcl
Size: 956 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20110822/21dea3e5/attachment.tcl>


More information about the Pd-dev mailing list