home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_gimp.idb / usr / freeware / share / gimp / scripts / beveled-pattern-heading.scm.z / beveled-pattern-heading.scm
Encoding:
GIMP Script-Fu Script  |  1999-07-21  |  3.6 KB  |  107 lines

  1. ; The GIMP -- an image manipulation program
  2. ; Copyright (C) 1995 Spencer Kimball and Peter Mattis
  3. ; Beveled pattern heading for web pages
  4. ; Copyright (C) 1997 Federico Mena Quintero
  5. ; federico@nuclecu.unam.mx
  6. ; This program is free software; you can redistribute it and/or modify
  7. ; it under the terms of the GNU General Public License as published by
  8. ; the Free Software Foundation; either version 2 of the License, or
  9. ; (at your option) any later version.
  10. ; This program is distributed in the hope that it will be useful,
  11. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. ; GNU General Public License for more details.
  14. ; You should have received a copy of the GNU General Public License
  15. ; along with this program; if not, write to the Free Software
  16. ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18.  
  19. (define (script-fu-beveled-pattern-heading
  20.      text text-size foundry family weight slant set-width spacing pattern transparent)
  21.   (let* ((old-bg-color (car (gimp-palette-get-background)))
  22.  
  23.      (img (car (gimp-image-new 10 10 RGB)))
  24.      (textl
  25.       (car
  26.        (gimp-text img -1 0 0 text 0 TRUE text-size PIXELS foundry family weight slant set-width spacing)))
  27.  
  28.      (width (car (gimp-drawable-width textl)))
  29.      (height (car (gimp-drawable-height textl)))
  30.  
  31.      (background (car (gimp-layer-new img width height RGBA_IMAGE "Background" 100 NORMAL)))
  32.      (bumpmap (car (gimp-layer-new img width height RGBA_IMAGE "Bumpmap" 100 NORMAL))))
  33.  
  34.     (gimp-image-disable-undo img)
  35.     (gimp-image-resize img width height 0 0)
  36.     (gimp-image-add-layer img background 1)
  37.     (gimp-image-add-layer img bumpmap 1)
  38.  
  39.     ; Create pattern layer
  40.  
  41.     (gimp-palette-set-background '(0 0 0))
  42.     (gimp-edit-fill img background)
  43.     (gimp-patterns-set-pattern pattern)
  44.     (gimp-bucket-fill img background PATTERN-BUCKET-FILL NORMAL 100 0 FALSE 0 0)
  45.  
  46.     ; Create bumpmap layer
  47.  
  48.     (gimp-edit-fill img bumpmap)
  49.  
  50.     (gimp-palette-set-background '(127 127 127))
  51.     (gimp-selection-layer-alpha img textl)
  52.     (gimp-selection-shrink img 1)
  53.     (gimp-edit-fill img bumpmap)
  54.  
  55.     (gimp-palette-set-background '(255 255 255))
  56.     (gimp-selection-layer-alpha img textl)
  57.     (gimp-selection-shrink img 2)
  58.     (gimp-edit-fill img bumpmap)
  59.  
  60.     (gimp-selection-none img)
  61.  
  62.     ; Bumpmap
  63.  
  64.     (plug-in-bump-map 1 img background bumpmap 135 45 2 0 0 0 0 TRUE FALSE 0)
  65.  
  66.     ; Clean up
  67.  
  68.     (gimp-palette-set-background '(0 0 0))
  69.     (gimp-selection-layer-alpha img textl)
  70.     (gimp-selection-invert img)
  71.     (gimp-edit-clear img background)
  72.     (gimp-selection-none img)
  73.  
  74.     (gimp-image-set-active-layer img background)
  75.     (gimp-image-remove-layer img bumpmap)
  76.     (gimp-image-remove-layer img textl)
  77.  
  78.     (if (= transparent FALSE)
  79.     (gimp-image-flatten img))
  80.  
  81.     (gimp-palette-set-background old-bg-color)
  82.     (gimp-image-enable-undo img)
  83.     (gimp-display-new img)))
  84.  
  85.  
  86. (script-fu-register "script-fu-beveled-pattern-heading"
  87.             "<Toolbox>/Xtns/Script-Fu/Web page themes/Beveled pattern/Heading"
  88.             "Beveled pattern heading"
  89.             "Federico Mena Quintero"
  90.             "Federico Mena Quintero"
  91.             "July 1997"
  92.             ""
  93.             SF-VALUE  "Text"                   "\"Hello world!\""
  94.             SF-VALUE  "Text size"              "72"
  95.             SF-VALUE  "Foundry"                "\"adobe\""
  96.             SF-VALUE  "Family"                 "\"utopia\""
  97.             SF-VALUE  "Weight"                 "\"bold\""
  98.             SF-VALUE  "Slant"                  "\"r\""
  99.             SF-VALUE  "Set width"              "\"normal\""
  100.             SF-VALUE  "Spacing"                "\"p\""
  101.             SF-VALUE  "Pattern"                "\"Wood\""
  102.             SF-TOGGLE "Transparent background" FALSE)
  103.