fixed up text

svn: r16625
This commit is contained in:
Robby Findler 2009-11-08 23:29:19 +00:00
parent c239a21885
commit 3e51bc7199
7 changed files with 28 additions and 8 deletions

View File

@ -680,9 +680,9 @@
(define (mk-single-text letter font-size color face family style weight underline)
(let ([text (make-text letter 0 1 color font-size face family style weight underline)])
(let-values ([(w h a d) (send text-sizing-bm get-text-extent letter (text->font text))])
(let-values ([(w h d a) (send text-sizing-bm get-text-extent letter (text->font text))])
(make-image text
(make-bb w h d)
(make-bb w h (- h d))
#f))))
(define/chk (triangle side-length mode color)

View File

@ -92,9 +92,11 @@
(list
'(overlay
(ellipse 10 10 "solid" "red")
(ellipse 30 30 "solid" "black")
(ellipse 20 20 "solid" "black")
(ellipse 30 30 "solid" "red")
(ellipse 40 40 "solid" "black")
(ellipse 50 50 "solid" "red")
(ellipse 70 70 "solid" "black"))
(ellipse 60 60 "solid" "black"))
"20.png")
(list
'(overlay

View File

@ -46,5 +46,6 @@
[fn
(cadr fn)]
[else
(fprintf (current-error-port) "exp->filename: unknown exp ~s\n" exp)
(unless (getenv "PLTSHOWIMAGES")
(fprintf (current-error-port) "exp->filename: unknown exp ~s\n" exp))
"unk.png"])))

View File

@ -129,7 +129,7 @@ Existing images can be rotated, scaled, and overlaid on top of each other.
based on the @scheme[family] is chosen. The @scheme[style] controls if the face is italic
or not (under Windows and Mac OS X, @scheme['slant] and @scheme['italic] are the same),
the @scheme[weight] controls if it is boldface (or light), and @scheme[underline?]
determines if the face is underlined. For more details on these arguments, see @scheme[face%],
determines if the face is underlined. For more details on these arguments, see @scheme[font%],
which ultimately is what this code uses to draw the font.
@image-examples[(text/font "Hello" 24 "olive"
@ -151,9 +151,11 @@ Existing images can be rotated, scaled, and overlaid on top of each other.
@image-examples[(overlay (ellipse 60 30 "solid" "purple")
(rectangle 30 60 "solid" "orange"))
(overlay (ellipse 10 10 "solid" "red")
(ellipse 30 30 "solid" "black")
(ellipse 20 20 "solid" "black")
(ellipse 30 30 "solid" "red")
(ellipse 40 40 "solid" "black")
(ellipse 50 50 "solid" "red")
(ellipse 70 70 "solid" "black"))]
(ellipse 60 60 "solid" "black"))]
}
@ -325,6 +327,10 @@ This section lists predicates for the basic structures provided by the image lib
@scheme['center],
@scheme["baseline"], or
@scheme['baseline].
The baseline of an image is the place where the bottoms any letters line up, not counting descenders, e.g. the tail on ``y'' or ``g'' or ``j''.
}
@defproc[(x-place? [x any/c]) boolean?]{

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 990 B

After

Width:  |  Height:  |  Size: 1007 B

View File

@ -553,3 +553,14 @@
(check-equal? (swizzle (list 0 1 2 3 4) 2)
(list 0 2 4 1 3))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; misc stuff
;;
(check-equal? (beside/places "baseline"
(text "a" 18 "black")
(text "b" 18 "black"))
(text "ab" 18 "black"))