home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 August / ENTER.ISO / files / gimp-2.0.5-i586-setup.exe / {app} / share / gimp / 2.0 / scripts / gimp-labels.scm < prev    next >
Encoding:
Text File  |  2004-09-26  |  6.6 KB  |  162 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. ; Changed on Feb 4, 1999 by Piet van Oostrum <piet@cs.uu.nl>
  31. ; For use with GIMP 1.1.
  32. ; All calls to gimp-text-* have been converted to use the *-fontname form.
  33. ; The corresponding parameters have been replaced by an SF-FONT parameter.
  34. ; ************************************************************************
  35.  
  36.  
  37. (define (script-fu-labels-gimp-org text font font-size text-color shadow-color bg-color rm-bg index num-colors color-thresh yoff xoff height)
  38.   (let* ((img (car (gimp-image-new 125 height RGB)))
  39.      (text-layer (car (gimp-text-fontname img -1 xoff yoff text 0
  40.                      TRUE font-size PIXELS
  41.                      font)))
  42.      (bg-layer (car (gimp-layer-new  img 125 height
  43.                      RGB-IMAGE "Background" 100 NORMAL-MODE)))
  44.      (shadow-layer (car (gimp-layer-copy text-layer TRUE)))
  45.      (old-fg (car (gimp-palette-get-foreground)))
  46.      (old-bg (car (gimp-palette-get-background))))
  47.     
  48.     (gimp-image-undo-disable img)
  49.     (gimp-image-add-layer img shadow-layer 1)
  50.     (gimp-image-add-layer img bg-layer 2)
  51.     
  52.     (gimp-layer-set-preserve-trans text-layer TRUE)
  53.     (gimp-layer-set-preserve-trans shadow-layer TRUE)
  54.     
  55.     (gimp-palette-set-background text-color)
  56.     (gimp-edit-fill text-layer BACKGROUND-FILL)
  57.  
  58.     (gimp-palette-set-background bg-color)
  59.     (gimp-edit-fill bg-layer BACKGROUND-FILL)
  60.  
  61.     (gimp-palette-set-background shadow-color)
  62.     (gimp-edit-fill shadow-layer BACKGROUND-FILL)
  63.     (gimp-layer-translate shadow-layer 1 1)
  64.  
  65.     (set! text-layer (car (gimp-image-flatten img)))
  66.     (gimp-layer-add-alpha text-layer)
  67.  
  68.     (if (= rm-bg TRUE)
  69.     (begin
  70.       (gimp-by-color-select text-layer bg-color
  71.                 color-thresh CHANNEL-OP-REPLACE TRUE FALSE 0 FALSE)
  72.       (gimp-edit-clear text-layer)
  73.       (gimp-selection-clear img)))
  74.     
  75.     (if (= index TRUE)
  76.        (gimp-image-convert-indexed img FS-DITHER MAKE-PALETTE num-colors
  77.                     FALSE FALSE ""))
  78.  
  79.     (gimp-palette-set-foreground old-fg)
  80.     (gimp-palette-set-background old-bg)
  81.     (gimp-image-undo-enable img)
  82.     (gimp-display-new img)))
  83.  
  84.  
  85. ;;;(define (script-fu-tube-button-label-gimp-org text rm-bg index)
  86. ;;;  (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))
  87. ;;;
  88. ;;;(define (script-fu-tube-subbutton-label-gimp-org text rm-bg index)
  89. ;;;  (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))
  90. ;;;  
  91. ;;;(define (script-fu-tube-subsubbutton-label-gimp-org text rm-bg index)
  92. ;;;  (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))
  93. ;;;
  94.  
  95. (define (script-fu-tube-button-label-gimp-org text rm-bg index)
  96.   (script-fu-labels-gimp-org text "helvetica" 14 '(86 114 172) '(255 255 255) '(255 255 255) rm-bg index 15 1 8 0 30))
  97.  
  98. (define (script-fu-tube-subbutton-label-gimp-org text rm-bg index)
  99.   (script-fu-labels-gimp-org text "helvetica" 12 '(86 114 172) '(255 255 255) '(255 255 255) rm-bg index 15 1 7 10 24))
  100.   
  101. (define (script-fu-tube-subsubbutton-label-gimp-org text rm-bg index)
  102.   (script-fu-labels-gimp-org text "helvetica" 10 '(86 114 172) '(255 255 255) '(255 255 255) rm-bg index 15 1 6 20 18))
  103.  
  104.  
  105. (script-fu-register "script-fu-tube-button-label-gimp-org"
  106.             _"<Toolbox>/Xtns/Script-Fu/Web Page Themes/Classic.Gimp.Org/_Tube Button Label..."
  107.             "Tube Button Label Header for gimp.org"
  108.             "Adrian Likins & Jens Lautenbacher"
  109.             "Adrian Likins & Jens Lautenbacher"
  110.             "1997"
  111.             ""
  112.             SF-STRING _"Text" "?"
  113.             SF-TOGGLE _"Remove Background" TRUE
  114.             SF-TOGGLE _"Index Image" TRUE)
  115.  
  116. (script-fu-register "script-fu-tube-subbutton-label-gimp-org"
  117.             _"<Toolbox>/Xtns/Script-Fu/Web Page Themes/Classic.Gimp.Org/T_ube Sub-Button Label..."
  118.             "Tube Button Label Header for gimp.org"
  119.             "Adrian Likins & Jens Lautenbacher"
  120.             "Adrian Likins & Jens Lautenbacher"
  121.             "1997"
  122.             ""
  123.             SF-STRING _"Text" "?"
  124.             SF-TOGGLE _"Remove Background" TRUE
  125.             SF-TOGGLE _"Index Image" TRUE)
  126.  
  127. (script-fu-register "script-fu-tube-subsubbutton-label-gimp-org"
  128.             _"<Toolbox>/Xtns/Script-Fu/Web Page Themes/Classic.Gimp.Org/Tub_e Sub-Sub-Button Label..."
  129.             "Tube Button Label Header for gimp.org"
  130.             "Adrian Likins & Jens Lautenbacher"
  131.             "Adrian Likins & Jens Lautenbacher"
  132.             "1997"
  133.             ""
  134.             SF-STRING _"Text" "?"
  135.             SF-TOGGLE _"Remove Background" TRUE
  136.             SF-TOGGLE _"Index Image" TRUE)
  137.  
  138.  
  139. (script-fu-register "script-fu-labels-gimp-org"
  140.             _"<Toolbox>/Xtns/Script-Fu/Web Page Themes/Classic.Gimp.Org/_General Tube Labels..."
  141.             "Tube Button Label Header for gimp.org"
  142.             "Adrian Likins & Jens Lautenbacher"
  143.             "Adrian Likins & Jens Lautenbacher"
  144.             "1997"
  145.             ""
  146.             SF-STRING _"Text" "Gimp.Org"
  147.             SF-FONT   _"Font" "Sans"
  148.             SF-ADJUSTMENT _"Font Size (pixels)" '(18 2 1000 1 10 0 1)
  149.              SF-COLOR  _"Text Color" '(130 165 235)
  150.              SF-COLOR  _"Shadow Color" '(0 0 0)
  151.             SF-COLOR  _"Background Color" '(255 255 255)
  152.             SF-TOGGLE _"Remove Background" TRUE
  153.             SF-TOGGLE _"Index Image" TRUE
  154.             SF-ADJUSTMENT _"Number of Colors" '(15 2 255 1 10 0 1)
  155.             SF-ADJUSTMENT _"Select-By-Color Threshold" '(1 1 256 1 10 0 1)
  156.             SF-ADJUSTMENT _"Offset X" '(8 0 50 1 10 0 1)
  157.             SF-ADJUSTMENT _"Offset Y" '(0 0 50 1 10 0 1)
  158.             SF-ADJUSTMENT _"Height"   '(30 2 1000 1 10 0 1))
  159.