[racket-dev] `dc-for-text-size' and font-metric hinting

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Fri Dec 17 09:21:01 EST 2010

I've changed `dc-for-text-size' in `sideshow/pict' so that its default
value is a bitmap DC. This change makes `slideshow/pict' easier to use
in non-Slideshow contexts, and it makes sense because font metrics with
the new `racket/draw' are almost always independent of the device
context.

Actually, by default, Cairo rounds font metrics to whole pixels for
bitmap and screen contexts under Unix. I've changed `racket/draw' so
that it turns off font-metric hinting, which makes font metrics
consistent across contexts and across different context transformations
(e.g., scaling). Font-metric hinting was already off by default (at the
Cairo level) under Windows and Mac OS X. In the long run, maybe hinting
should be configurable, but I'm curious whether anyone can tell the
difference with the setting that's simpler for `slideshow/pict'-like
tasks.



Posted on the dev mailing list.