2006-12-10 05:33:38 +08:00
|
|
|
; GIMP - The GNU Image Manipulation Program
|
1997-11-25 06:05:25 +08:00
|
|
|
; Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
2006-10-16 09:08:54 +08:00
|
|
|
;
|
1997-11-25 06:05:25 +08:00
|
|
|
; www.gimp.org web headers
|
|
|
|
; Copyright (c) 1997 Adrian Likins
|
|
|
|
; aklikins@eos.ncsu.edu
|
|
|
|
;
|
|
|
|
; based on a idea by jtl (Jens Lautenbacher)
|
|
|
|
; and improved by jtl
|
|
|
|
;
|
2009-01-18 06:28:01 +08:00
|
|
|
; This program is free software: you can redistribute it and/or modify
|
1997-11-25 06:05:25 +08:00
|
|
|
; it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
; the Free Software Foundation; either version 3 of the License, or
|
1997-11-25 06:05:25 +08:00
|
|
|
; (at your option) any later version.
|
2006-10-16 09:08:54 +08:00
|
|
|
;
|
1997-11-25 06:05:25 +08:00
|
|
|
; This program is distributed in the hope that it will be useful,
|
|
|
|
; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
; GNU General Public License for more details.
|
2006-10-16 09:08:54 +08:00
|
|
|
;
|
1997-11-25 06:05:25 +08:00
|
|
|
; You should have received a copy of the GNU General Public License
|
2009-01-18 06:28:01 +08:00
|
|
|
; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
1997-11-25 06:05:25 +08:00
|
|
|
;
|
|
|
|
; **NOTE** This fonts use some very common fonts, that are typically
|
|
|
|
; bitmap fonts on most installations. If you want better quality versions
|
|
|
|
; you need to grab the urw font package form www.gimp.org/fonts.html
|
|
|
|
; and install as indicated. This will replace the some current bitmap fonts
|
|
|
|
; with higher quality vector fonts. This is how the actual www.gimp.org
|
|
|
|
; logos were created.
|
|
|
|
;
|
1999-03-07 23:11:11 +08:00
|
|
|
; ************************************************************************
|
|
|
|
; Changed on Feb 4, 1999 by Piet van Oostrum <piet@cs.uu.nl>
|
|
|
|
; For use with GIMP 1.1.
|
|
|
|
; All calls to gimp-text-* have been converted to use the *-fontname form.
|
|
|
|
; The corresponding parameters have been replaced by an SF-FONT parameter.
|
|
|
|
; ************************************************************************
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-03-07 23:11:11 +08:00
|
|
|
(define (script-fu-headers-gimp-org text font font-size text-color high-color side-color shadow-color crop rm-bg index num-colors)
|
2006-10-16 09:08:54 +08:00
|
|
|
(let* (
|
|
|
|
(img (car (gimp-image-new 256 256 RGB)))
|
|
|
|
(text-layer (car (gimp-text-fontname img -1 0 0
|
|
|
|
text 30 TRUE font-size PIXELS
|
|
|
|
font)))
|
|
|
|
(width (car (gimp-drawable-width text-layer)))
|
|
|
|
(height (car (gimp-drawable-height text-layer)))
|
|
|
|
(bg-layer (car (gimp-layer-new img width height RGB-IMAGE "Background" 100 NORMAL-MODE)))
|
|
|
|
)
|
2004-09-23 07:33:29 +08:00
|
|
|
|
|
|
|
(gimp-context-push)
|
|
|
|
|
1999-10-17 08:07:55 +08:00
|
|
|
(gimp-image-undo-disable img)
|
1997-11-25 06:05:25 +08:00
|
|
|
(gimp-image-resize img width height 0 0)
|
|
|
|
(gimp-image-add-layer img bg-layer 1)
|
2005-07-11 05:17:22 +08:00
|
|
|
(gimp-layer-set-lock-alpha text-layer TRUE)
|
2004-09-23 02:43:09 +08:00
|
|
|
(gimp-context-set-background text-color)
|
2003-10-16 20:47:33 +08:00
|
|
|
(gimp-edit-fill text-layer BACKGROUND-FILL)
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2004-09-23 02:43:09 +08:00
|
|
|
(gimp-context-set-background '(255 255 255))
|
2003-10-16 20:47:33 +08:00
|
|
|
(gimp-edit-fill bg-layer BACKGROUND-FILL)
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2006-10-16 09:08:54 +08:00
|
|
|
(let* (
|
|
|
|
(highlight-layer (car (gimp-layer-copy text-layer TRUE)))
|
|
|
|
(side-layer (car (gimp-layer-copy text-layer TRUE)))
|
|
|
|
(shadow-layer (car (gimp-layer-copy text-layer TRUE)))
|
|
|
|
)
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
(gimp-image-add-layer img highlight-layer 1)
|
2005-07-11 05:17:22 +08:00
|
|
|
(gimp-layer-set-lock-alpha highlight-layer TRUE)
|
2006-10-16 09:08:54 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
(gimp-image-add-layer img side-layer 1)
|
2005-07-11 05:17:22 +08:00
|
|
|
(gimp-layer-set-lock-alpha side-layer TRUE)
|
2006-10-16 09:08:54 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
(gimp-image-add-layer img shadow-layer 1)
|
2005-07-11 05:17:22 +08:00
|
|
|
(gimp-layer-set-lock-alpha shadow-layer TRUE)
|
2006-10-16 09:08:54 +08:00
|
|
|
|
2004-09-23 02:43:09 +08:00
|
|
|
(gimp-context-set-background high-color)
|
2003-10-16 20:47:33 +08:00
|
|
|
(gimp-edit-fill highlight-layer BACKGROUND-FILL)
|
1997-11-25 06:05:25 +08:00
|
|
|
(gimp-layer-translate highlight-layer -1 -1)
|
2006-10-16 09:08:54 +08:00
|
|
|
|
2004-09-23 02:43:09 +08:00
|
|
|
(gimp-context-set-background side-color)
|
2003-10-16 20:47:33 +08:00
|
|
|
(gimp-edit-fill side-layer BACKGROUND-FILL)
|
1997-11-25 06:05:25 +08:00
|
|
|
(gimp-layer-translate side-layer 1 1)
|
|
|
|
|
2004-09-23 02:43:09 +08:00
|
|
|
(gimp-context-set-background shadow-color)
|
2003-10-16 20:47:33 +08:00
|
|
|
(gimp-edit-fill shadow-layer BACKGROUND-FILL)
|
1997-11-25 06:05:25 +08:00
|
|
|
(gimp-layer-translate shadow-layer 5 5)
|
2006-10-16 09:08:54 +08:00
|
|
|
|
2005-07-11 05:17:22 +08:00
|
|
|
(gimp-layer-set-lock-alpha shadow-layer FALSE)
|
2007-10-02 03:44:23 +08:00
|
|
|
(plug-in-gauss-rle RUN-NONINTERACTIVE img shadow-layer 5 TRUE TRUE)
|
1997-11-25 06:05:25 +08:00
|
|
|
(gimp-layer-set-opacity shadow-layer 60)
|
|
|
|
(gimp-image-lower-layer img shadow-layer)
|
2006-10-16 09:08:54 +08:00
|
|
|
(gimp-image-lower-layer img shadow-layer)
|
|
|
|
)
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
(set! text-layer (car (gimp-image-flatten img)))
|
1998-11-15 04:46:25 +08:00
|
|
|
(gimp-layer-add-alpha text-layer)
|
2006-10-16 09:08:54 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
(if (= rm-bg TRUE)
|
2006-10-16 09:08:54 +08:00
|
|
|
(begin
|
|
|
|
(gimp-by-color-select text-layer '(255 255 255)
|
|
|
|
1 CHANNEL-OP-REPLACE TRUE FALSE 0 FALSE)
|
|
|
|
(gimp-edit-clear text-layer)
|
|
|
|
(gimp-selection-none img)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
(if (= crop TRUE)
|
2007-10-02 03:44:23 +08:00
|
|
|
(plug-in-autocrop RUN-NONINTERACTIVE img text-layer)
|
2006-10-16 09:08:54 +08:00
|
|
|
)
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
(if (= index TRUE)
|
2006-10-16 09:08:54 +08:00
|
|
|
(gimp-image-convert-indexed img FS-DITHER MAKE-PALETTE num-colors
|
|
|
|
FALSE FALSE "")
|
|
|
|
)
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-10-17 08:07:55 +08:00
|
|
|
(gimp-image-undo-enable img)
|
1997-11-25 06:05:25 +08:00
|
|
|
(gimp-display-new img)
|
|
|
|
|
2006-10-16 09:08:54 +08:00
|
|
|
(gimp-context-pop)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
(define (script-fu-big-header-gimp-org text font font-size text-color
|
2006-10-16 09:08:54 +08:00
|
|
|
high-color side-color shadow-color
|
|
|
|
crop rm-bg index num-colors)
|
1997-11-25 06:05:25 +08:00
|
|
|
(script-fu-headers-gimp-org (string-append " " text)
|
2006-10-16 09:08:54 +08:00
|
|
|
font font-size
|
|
|
|
text-color high-color side-color shadow-color
|
|
|
|
crop rm-bg index num-colors)
|
|
|
|
)
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
|
|
|
|
(define (script-fu-small-header-gimp-org text font font-size text-color
|
2006-10-16 09:08:54 +08:00
|
|
|
high-color side-color shadow-color
|
|
|
|
crop rm-bg index num-colors)
|
1999-03-07 23:11:11 +08:00
|
|
|
(script-fu-headers-gimp-org text font
|
2006-10-16 09:08:54 +08:00
|
|
|
font-size text-color high-color
|
|
|
|
side-color shadow-color
|
|
|
|
crop rm-bg index num-colors)
|
|
|
|
)
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
|
|
|
|
(script-fu-register "script-fu-big-header-gimp-org"
|
2006-10-16 09:08:54 +08:00
|
|
|
_"_Big Header..."
|
|
|
|
_"Create an image of a large header using the gimp.org webpage theme"
|
|
|
|
"Adrian Likins & Jens Lautenbacher"
|
|
|
|
"Adrian Likins & Jens Lautenbacher"
|
|
|
|
"1997"
|
|
|
|
""
|
|
|
|
SF-STRING _"Text" "gimp.org"
|
|
|
|
SF-FONT _"Font" "Serif"
|
|
|
|
SF-ADJUSTMENT _"Font size (pixels)" '(50 2 1000 1 10 0 1)
|
|
|
|
SF-COLOR _"Text color" '(82 108 159)
|
|
|
|
SF-COLOR _"Highlight color" '(190 220 250)
|
|
|
|
SF-COLOR _"Dark color" '(46 74 92)
|
2006-10-21 01:55:14 +08:00
|
|
|
SF-COLOR _"Shadow color" "black"
|
2006-10-16 09:08:54 +08:00
|
|
|
SF-TOGGLE _"Autocrop" TRUE
|
|
|
|
SF-TOGGLE _"Remove background" TRUE
|
|
|
|
SF-TOGGLE _"Index image" TRUE
|
|
|
|
SF-ADJUSTMENT _"Number of colors" '(15 2 255 1 10 0 1)
|
|
|
|
)
|
2004-11-19 06:44:28 +08:00
|
|
|
|
|
|
|
(script-fu-menu-register "script-fu-big-header-gimp-org"
|
2008-09-19 20:01:12 +08:00
|
|
|
"<Image>/File/Create/Web Page Themes/Classic.Gimp.Org")
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
(script-fu-register "script-fu-small-header-gimp-org"
|
2006-10-16 09:08:54 +08:00
|
|
|
_"_Small Header..."
|
|
|
|
_"Create an image of a small header using the gimp.org webpage theme"
|
|
|
|
"Adrian Likins & Jens Lautenbacher"
|
|
|
|
"Adrian Likins & Jens Lautenbacher"
|
|
|
|
"1997"
|
|
|
|
""
|
|
|
|
SF-STRING _"Text" "gimp.org"
|
|
|
|
SF-FONT _"Font" "Sans"
|
|
|
|
SF-ADJUSTMENT _"Font size (pixels)" '(24 2 1000 1 10 0 1)
|
|
|
|
SF-COLOR _"Text color" '(135 220 220)
|
|
|
|
SF-COLOR _"Highlight color" '(210 240 245)
|
|
|
|
SF-COLOR _"Dark color" '(46 74 92)
|
2006-10-21 01:55:14 +08:00
|
|
|
SF-COLOR _"Shadow color" "black"
|
2006-10-16 09:08:54 +08:00
|
|
|
SF-TOGGLE _"Autocrop" TRUE
|
|
|
|
SF-TOGGLE _"Remove background" TRUE
|
|
|
|
SF-TOGGLE _"Index image" TRUE
|
|
|
|
SF-ADJUSTMENT _"Number of colors" '(15 2 255 1 10 0 1)
|
|
|
|
SF-ADJUSTMENT _"Select-by-color threshold" '(1 1 256 1 10 0 1)
|
|
|
|
)
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2004-11-19 06:44:28 +08:00
|
|
|
(script-fu-menu-register "script-fu-small-header-gimp-org"
|
2008-09-19 20:01:12 +08:00
|
|
|
"<Image>/File/Create/Web Page Themes/Classic.Gimp.Org")
|