(define (script-fu-text-box inText inFont inFontSize inTextColor inBufferAmount) (let* ( ; Definition unserer lokalen Variablen ; Erzeugen des neuen Bildes (theImageWidth 10) (theImageHeight 10) (theImage ( car (gimp-image-new theImageWidth theImageHeight RGB) ) ) (theText) (theBuffer) ; Erzeugen einer neuen Ebene zum Bild (theLayer (car (gimp-layer-new theImage theImageWidth theImageHeight RGB_IMAGE "Ebene 1" 100 NORMAL) ) ) ; Ende unserer lokalen Variablen ) (gimp-image-add-layer theImage theLayer 0) ; zum Anzeigen des leeren Bildes ; (gimp-display-new theImage) (gimp-palette-set-background '(255 255 255) ) (gimp-palette-set-foreground inTextColor) (gimp-selection-all theImage) (gimp-edit-clear theLayer) (gimp-selection-none theImage) (set! theText (car (gimp-text-fontname theImage theLayer 0 0 inText 0 TRUE inFontSize PIXELS inFont))) (set! theImageWidth (car (gimp-drawable-width theText) ) ) (set! theImageHeight (car (gimp-drawable-height theText) ) ) (set! theBuffer (* theImageHeight (/ inBufferAmount 100) ) ) (set! theImageHeight (+ theImageHeight theBuffer theBuffer) ) (set! theImageWidth (+ theImageWidth theBuffer theBuffer) ) (gimp-image-resize theImage theImageWidth theImageHeight 0 0) (gimp-layer-resize theLayer theImageWidth theImageHeight 0 0) (gimp-layer-set-offsets theText theBuffer theBuffer) (gimp-display-new theImage) (list theImage theLayer theText) ; Bereinigen Dirty-Flag ;(gimp-image-clean-all theImage) ) ) (script-fu-register "script-fu-text-box" "/Xtns/Script-Fu/Test/Text Box..." "Creates a simple text box, sized to fit around the user's choice of text, font, font size, and color." "Michael Terry" "copyright 1997, Michael Terry" "october 27, 1997" "" SF-STRING "Text:" "Text Box" SF-FONT "Font:" "-*-Roostheavy-*-r-*-*-24-*-*-*-p-*-*-*" SF-VALUE "Font size:" "45" SF-COLOR "Color:" '(0 0 0) SF-VALUE "Buffer amount (0-100% height of text):" "35" )