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 / gimp-labels.scm.z / gimp-labels.scm
Encoding:
Text File  |  1999-07-21  |  6.2 KB  |  158 lines

  1. ; The GIMP -- an image manipulation program
  2. ; Copyright (C) 1995 Spencer Kimball and Peter Mattis
  3. ; www.gimp.org web labels
  4. ; Copyright (c) 1997 Adrian Likins
  5. ; aklikins@eos.ncsu.edu
  6. ;
  7. ; based on a idea by jtl (Jens  Lautenbacher)
  8. ; and improved by jtl
  9. ;
  10. ; This program is free software; you can redistribute it and/or modify
  11. ; it under the terms of the GNU General Public License as published by
  12. ; the Free Software Foundation; either version 2 of the License, or
  13. ; (at your option) any later version.
  14. ; This program is distributed in the hope that it will be useful,
  15. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. ; GNU General Public License for more details.
  18. ; You should have received a copy of the GNU General Public License
  19. ; along with this program; if not, write to the Free Software
  20. ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21. ;
  22. ;  **NOTE**  This fonts use some very common fonts, that are typically
  23. ;  bitmap fonts on most installations. If you want better quality versions
  24. ;  you need to grab the urw font package form www.gimp.org/fonts.html
  25. ;  and install as indicated. This will replace the some current bitmap fonts
  26. ;  with higher quality vector fonts. This is how the actual www.gimp.org
  27. ;  logos were created.
  28. ;
  29.  
  30.  
  31. (define (script-fu-labels-gimp-org text font font-size weight slant width text-color shadow-color bg-color rm-bg index num-colors color-thresh yoff xoff height)
  32.   (let* ((img (car (gimp-image-new 125 height RGB)))
  33.      (text-layer (car (gimp-text img -1 xoff yoff text 0
  34.                      TRUE font-size PIXELS
  35.                      "*" font weight slant width "*")))
  36.      (bg-layer (car (gimp-layer-new  img 125 height
  37.                      RGB_IMAGE "Background" 100 NORMAL)))
  38.      (shadow-layer (car (gimp-layer-copy text-layer TRUE)))
  39.      (old-fg (car (gimp-palette-get-foreground)))
  40.      (old-bg (car (gimp-palette-get-background))))
  41.     
  42.     (gimp-image-disable-undo img)
  43.     (gimp-image-add-layer img shadow-layer 1)
  44.     (gimp-image-add-layer img bg-layer 2)
  45.     
  46.     (gimp-layer-set-preserve-trans text-layer TRUE)
  47.     (gimp-layer-set-preserve-trans shadow-layer TRUE)
  48.     
  49.     (gimp-palette-set-background text-color)
  50.     (gimp-edit-fill img text-layer)
  51.  
  52.     (gimp-palette-set-background bg-color)
  53.     (gimp-edit-fill img bg-layer)
  54.  
  55.     (gimp-palette-set-background shadow-color)
  56.     (gimp-edit-fill img shadow-layer)
  57.     (gimp-layer-translate shadow-layer 1 1)
  58.  
  59.     (set! text-layer (car (gimp-image-flatten img)))
  60.     (gimp-layer-add-alpha text-layer)       
  61.  
  62.     (if (= rm-bg TRUE)
  63.     (begin
  64.       (gimp-by-color-select img text-layer bg-color
  65.                 color-thresh REPLACE TRUE FALSE 0 FALSE)
  66.       (gimp-edit-clear img text-layer)
  67.       (gimp-selection-clear img)))
  68.     
  69.     (if (= index TRUE)
  70.     (gimp-convert-indexed img TRUE num-colors))
  71.    
  72.     (gimp-palette-set-foreground old-fg)
  73.     (gimp-palette-set-background old-bg)
  74.     (gimp-image-enable-undo img)
  75.     (gimp-display-new img)))
  76.  
  77.  
  78. ;;;(define (script-fu-tube-button-label-gimp-org text rm-bg index)
  79. ;;;  (script-fu-labels-gimp-org text "nimbus sans" 14 "medium" "r" "normal" '(151 177 192) '(0 0 0) '(255 255 255) rm-bg index 15 1 8 0 30))
  80. ;;;
  81. ;;;(define (script-fu-tube-subbutton-label-gimp-org text rm-bg index)
  82. ;;;  (script-fu-labels-gimp-org text "nimbus sans" 12 "medium" "r" "normal" '(151 177 192) '(0 0 0) '(255 255 255) rm-bg index 15 1 7 0 24))
  83. ;;;  
  84. ;;;(define (script-fu-tube-subsubbutton-label-gimp-org text rm-bg index)
  85. ;;;  (script-fu-labels-gimp-org text "nimbus sans" 10 "medium" "r" "normal" '(151 177 192) '(0 0 0) '(255 255 255) rm-bg index 15 1 6 0 18))
  86. ;;;
  87.  
  88. (define (script-fu-tube-button-label-gimp-org text rm-bg index)
  89.   (script-fu-labels-gimp-org text "helvetica" 14 "medium" "r" "normal" '(86 114 172) '(255 255 255) '(255 255 255) rm-bg index 15 1 8 0 30))
  90.  
  91. (define (script-fu-tube-subbutton-label-gimp-org text rm-bg index)
  92.   (script-fu-labels-gimp-org text "helvetica" 12 "medium" "r" "normal" '(86 114 172) '(255 255 255) '(255 255 255) rm-bg index 15 1 7 10 24))
  93.   
  94. (define (script-fu-tube-subsubbutton-label-gimp-org text rm-bg index)
  95.   (script-fu-labels-gimp-org text "helvetica" 10 "medium" "r" "normal" '(86 114 172) '(255 255 255) '(255 255 255) rm-bg index 15 1 6 20 18))
  96.  
  97.  
  98. (script-fu-register "script-fu-tube-button-label-gimp-org"
  99.             "<Toolbox>/Xtns/Script-Fu/Web page themes/Gimp.Org/Tube Button Label"
  100.             "Tube Button Label Header for gimp.org"
  101.             "Adrian Likins & Jens Lautenbacher"
  102.             "Adrian Likins & Jens Lautenbacher"
  103.             "1997"
  104.             ""
  105.             SF-VALUE "Text String" "\"?\""
  106.             SF-TOGGLE "Remove Background" TRUE
  107.             SF-TOGGLE "Index Image" TRUE)
  108.  
  109. (script-fu-register "script-fu-tube-subbutton-label-gimp-org"
  110.             "<Toolbox>/Xtns/Script-Fu/Web page themes/Gimp.Org/Tube Sub-Button Label"
  111.             "Tube Button Label Header for gimp.org"
  112.             "Adrian Likins & Jens Lautenbacher"
  113.             "Adrian Likins & Jens Lautenbacher"
  114.             "1997"
  115.             ""
  116.             SF-VALUE "Text String" "\"?\""
  117.             SF-TOGGLE "Remove Background" TRUE
  118.             SF-TOGGLE "Index Image" TRUE)
  119.  
  120. (script-fu-register "script-fu-tube-subsubbutton-label-gimp-org"
  121.             "<Toolbox>/Xtns/Script-Fu/Web page themes/Gimp.Org/Tube Sub-Sub-Button Label"
  122.             "Tube Button Label Header for gimp.org"
  123.             "Adrian Likins & Jens Lautenbacher"
  124.             "Adrian Likins & Jens Lautenbacher"
  125.             "1997"
  126.             ""
  127.             SF-VALUE "Text String" "\"?\""
  128.             SF-TOGGLE "Remove Background" TRUE
  129.             SF-TOGGLE "Index Image" TRUE)
  130.  
  131.  
  132. (script-fu-register "script-fu-labels-gimp-org"
  133.             "<Toolbox>/Xtns/Script-Fu/Web page themes/Gimp.Org/General Tube Labels"
  134.             "Tube Button Label Header for gimp.org"
  135.             "Adrian Likins & Jens Lautenbacher"
  136.             "Adrian Likins & Jens Lautenbacher"
  137.             "1997"
  138.             ""
  139.             SF-VALUE "Text String" "\"Gimp.Org\""
  140.             SF-VALUE "Font" "\"helvetica\""
  141.             SF-VALUE "Font Size" "18"
  142.             SF-VALUE "Weight" "\"medium\""
  143.             SF-VALUE "Slant" "\"r\""
  144.             SF-VALUE "Width" "\"normal\""
  145.              SF-COLOR "Text Color" '(130 165 235)
  146.              SF-COLOR "Shadow Color" '(0 0 0)
  147.             SF-COLOR "Background Color" '(255 255 255)
  148.             SF-TOGGLE "Remove Background" TRUE
  149.             SF-TOGGLE "Index Image" TRUE
  150.             SF-VALUE "# of colors" "15"
  151.             SF-VALUE "select-by-color threshold" "1"
  152.             SF-VALUE "Y-Offset" "8"
  153.             SF-VALUE "X-Offset" "0"
  154.             SF-VALUE "Height"   "30")
  155.