;;; Procedure: ;;; new-no-failure ;;; Parameters: ;;; side, an integer ;;; color, an RGB list ;;; Purpose: ;;; Creates a new image with the universal sign for "No Fs". ;;; The image has width side and height side. ;;; The F in the image has the specified color. ;;; Produces: ;;; Nothing. You call this only for the side effect of ;;; drawing a new image. ;;; Preconditions: ;;; Must be called from within Script-Fu. ;;; Postconditions: ;;; A new image appears on the screen. (define new-no-failure (lambda (side color) (let ((image (create-image side side)) (unit (/ side 32))) ; Draw everything on white (set-bgcolor WHITE) ; Draw the silly letter F in the specified color (set-fgcolor color) (gimp-brushes-set-brush "Circle (11)") (line image (* unit 12) (* unit 5) (* unit 20) (* unit 5)) (line image (* unit 12) (* unit 5) (* unit 12) (* unit 27)) (line image (* unit 12) (* unit 14) (* unit 18) (* unit 14)) ; Draw the nice red circle. (set-fgcolor RED) (set-brush "Circle (07)") (select-ellipse image REPLACE unit unit (- side unit unit) (- side unit unit)) (stroke image) (select-nothing image) ; Now we're ready to draw the slash. Basic math tells us that ; the endpoints are offset by radius/(sqrt 2) from the center ; of the circle. ; direction. (let* ((center (/ side 2)) (radius (- center unit)) (offset (/ radius (sqrt 2)))) (line image (- center offset) (- center offset) (+ center offset) (+ center offset))) ; Display the image (show-image image) ; And return the image image)))