home *** CD-ROM | disk | FTP | other *** search
/ Chip 1999 July / CHIP-1999-07.iso / software / gimp / GIMP-SET.EXE / file0380_39fccc_39ffea.bin < prev    next >
Encoding:
Text File  |  1999-02-28  |  2.1 KB  |  49 lines

  1. ;  DROP-SHADOW-LOGO
  2. ;  draw the specified text over a background with a drop shadow
  3.  
  4. (define (script-fu-basic1-logo text size font bg-color text-color)
  5.   (let* ((img (car (gimp-image-new 256 256 RGB)))
  6.      (text-layer (car (gimp-text-fontname img -1 0 0 text 10 TRUE size PIXELS font)))
  7.      (width (car (gimp-drawable-width text-layer)))
  8.      (height (car (gimp-drawable-height text-layer)))
  9.      (bg-layer (car (gimp-layer-new img width height RGB_IMAGE "Background" 100 NORMAL)))
  10.      (shadow-layer (car (gimp-layer-new img width height RGBA_IMAGE "Shadow" 100 MULTIPLY)))
  11.      (old-fg (car (gimp-palette-get-foreground)))
  12.      (old-bg (car (gimp-palette-get-background))))
  13.     (gimp-image-disable-undo img)
  14.     (gimp-image-resize img width height 0 0)
  15.     (gimp-image-add-layer img shadow-layer 1)
  16.     (gimp-image-add-layer img bg-layer 2)
  17.     (gimp-palette-set-background text-color)
  18.     (gimp-layer-set-preserve-trans text-layer TRUE)
  19.     (gimp-edit-fill text-layer)
  20.     (gimp-palette-set-background bg-color)
  21.     (gimp-edit-fill bg-layer)
  22.     (gimp-edit-clear shadow-layer)
  23.     (gimp-selection-layer-alpha text-layer)
  24.     (gimp-palette-set-background '(0 0 0))
  25.     (gimp-selection-feather img 7.5)
  26.     (gimp-edit-fill shadow-layer)
  27.     (gimp-selection-none img)
  28.     (gimp-palette-set-foreground '(255 255 255))
  29.     (gimp-blend text-layer FG-BG-RGB MULTIPLY RADIAL 100 20 REPEAT-NONE FALSE 0 0 0 0 width height)
  30.     (gimp-layer-translate shadow-layer 3 3)
  31.     (gimp-layer-set-name text-layer text)
  32.     (gimp-palette-set-background old-bg)
  33.     (gimp-palette-set-foreground old-fg)
  34.     (gimp-image-enable-undo img)
  35.     (gimp-display-new img)))
  36.  
  37. (script-fu-register "script-fu-basic1-logo"
  38.             "<Toolbox>/Xtns/Script-Fu/Logos/Basic I"
  39.             "Creates a simple logo with a drop shadow"
  40.             "Spencer Kimball"
  41.             "Spencer Kimball"
  42.             "1996"
  43.             ""
  44.             SF-STRING "Text String" "The Gimp"
  45.             SF-ADJUSTMENT "Font Size (pixels)" '(100 2 1000 1 10 0 1)
  46.             SF-FONT "Font" "-*-Dragonwick-*-r-*-*-24-*-*-*-p-*-*-*"
  47.             SF-COLOR "Background Color" '(255 255 255)
  48.             SF-COLOR "Text Color" '(6 6 206))
  49.