[racket-dev] Plot testing and feedback

From: Neil Toronto (neil.toronto at gmail.com)
Date: Sat Aug 13 10:23:11 EDT 2011

On 08/13/2011 05:58 AM, Matthew Flatt wrote:
> The Mac's drawing layer equates drawing units and font point sizes,
> while the drawing layers for Windows and Unix try to adapt the to the
> screen resolution for the conversion of point-sizes to drawing-unit.
>
> For drawing pictures, it usually works better for me to use an
> N-"pixel" font instead of an N-point font (where "pixel" really means
> "drawing unit").
>
> I've never found `get-char-width' to be particularly useful, because
> the average character width sometimes includes Unicode characters and
> sometimes doesn't.
>
> It looks like your code is using 8 points and `get-char-width' in an
> attempt to pick a good drawing scale for the target device. I think you
> flip those around: pick a width and height in drawing units that looks
> about right on your screen, and pick a font in drawing-unit "pixels"
> instead of points. A good screen scale is a good default bitmap scale,
> the 80% default scaling for PS/PDF output will then make the output in
> PS/PDF have a reasonable default size.

Excellent - that helps a lot.

Jay, I've pushed changes that set font size in "pixels" and calculate 
plot margins using the actual sizes of the tick labels instead of 
guesses based on get-char-width. It still looks nice on mine, so I 
assume it will on Windows as well. Can you try it on your Mac again?

Thanks!
Neil T



Posted on the dev mailing list.