diff --git a/collects/2htdp/private/image-more.ss b/collects/2htdp/private/image-more.ss index a183c8d033..0488d78b63 100644 --- a/collects/2htdp/private/image-more.ss +++ b/collects/2htdp/private/image-more.ss @@ -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) diff --git a/collects/teachpack/2htdp/scribblings/image-toc.ss b/collects/teachpack/2htdp/scribblings/image-toc.ss index 83cb660056..adb30f486f 100644 --- a/collects/teachpack/2htdp/scribblings/image-toc.ss +++ b/collects/teachpack/2htdp/scribblings/image-toc.ss @@ -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 diff --git a/collects/teachpack/2htdp/scribblings/image-util.ss b/collects/teachpack/2htdp/scribblings/image-util.ss index cc2b8c088b..53a3e8d9c0 100644 --- a/collects/teachpack/2htdp/scribblings/image-util.ss +++ b/collects/teachpack/2htdp/scribblings/image-util.ss @@ -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"]))) diff --git a/collects/teachpack/2htdp/scribblings/image.scrbl b/collects/teachpack/2htdp/scribblings/image.scrbl index 2ed3b7e91e..b66ba7e7fe 100644 --- a/collects/teachpack/2htdp/scribblings/image.scrbl +++ b/collects/teachpack/2htdp/scribblings/image.scrbl @@ -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?]{ diff --git a/collects/teachpack/2htdp/scribblings/img/20.png b/collects/teachpack/2htdp/scribblings/img/20.png index 782032484f..c7a53e79ba 100644 Binary files a/collects/teachpack/2htdp/scribblings/img/20.png and b/collects/teachpack/2htdp/scribblings/img/20.png differ diff --git a/collects/teachpack/2htdp/scribblings/img/30.png b/collects/teachpack/2htdp/scribblings/img/30.png index 2e2cb68b26..36949fd2ba 100644 Binary files a/collects/teachpack/2htdp/scribblings/img/30.png and b/collects/teachpack/2htdp/scribblings/img/30.png differ diff --git a/collects/tests/2htdp/test-image.ss b/collects/tests/2htdp/test-image.ss index b651402514..d50ef3dccc 100644 --- a/collects/tests/2htdp/test-image.ss +++ b/collects/tests/2htdp/test-image.ss @@ -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"))