plt/racket — pull request #215 by simmone (2013-01-22 08:10:26+00:00)
Title: font% use 'modern family on macosx bug fix

use font% with family 'modern(fixed width) on macosx will cut away a piece on right side.

example:

#lang racket

(require racket/draw racket/gui)

(define test-bitmap (make-object bitmap% 200 200))
(define image-dc (send test-bitmap make-dc))

(send image-dc set-background "white")
(send image-dc clear)
(send image-dc set-smoothing 'smoothed)
(send image-dc set-text-foreground "black")
(send image-dc set-brush "white" 'transparent)
(send image-dc set-pen "black" 1 'solid)
(define my-font (make-object font% 100 'modern 'normal 'bold))
(send image-dc set-font my-font)
(let-values ([(width height _1 _2)
(send image-dc get-text-extent "3" my-font)])
(send image-dc draw-text "3"
(- (quotient 200 2) (quotient width 2))
(- (quotient 200 2) (quotient height 2))))

(make-object image-snip% test-bitmap)

set 'modern on macosx use the font "Monospace", fixed.