; The GIMP -- an image manipulation program ; Copyright (C) 1995 Spencer Kimball and Peter Mattis ; ; ; Copyright (c) 2002 Matteo Nastasi aka MatOfPenguins aka mop ; nastasi@alternativeoutput.it ; matteo.nastasi@milug.org ; ; Create a menu button from parameter (2 text lines, hilite) ; ; ; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation; either version 2 of the License, or ; (at your option) any later version. ; ; 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. ; ; You should have received a copy of the GNU General Public License ; along with this program; if not, write to the Free Software ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (define (script-fu-aonew-menu2hl border inmeno altezza txt txt2 outfile) (define (update-segment! s x0 y0 x1 y1) (aset s 0 x0) (aset s 1 y0) (aset s 2 x1) (aset s 3 y1)) (let* ((segment (cons-array 4 'double)) (img (car (gimp-image-new 512 100 RGB))) (drawable (car (gimp-layer-new img 512 100 RGB-IMAGE "Jabar" 100 NORMAL))) ) (gimp-image-add-layer img drawable 0) (gimp-palette-set-foreground '(232 226 212)) (gimp-palette-set-background '(145 23 25)) (gimp-edit-clear drawable) ;; (set! templayer (car (gimp-text-fontname img drawable 0 0 txt border TRUE altezza PIXELS "-adobe-avantgarde-demi-r-normal-*-*-140-*-*-p-*-iso8859-1"))) (set! templayer (car (gimp-text-fontname img drawable 0 0 txt border TRUE altezza PIXELS "URW Gothic L, Semi-Bold"))) (set! larg (car (gimp-drawable-width templayer))) (set! alte (car (gimp-drawable-height templayer))) (gimp-floating-sel-anchor templayer) (set! offs (- altezza inmeno)) ;; (set! templayer (car (gimp-text-fontname img drawable 0 offs txt2 border TRUE altezza PIXELS "-adobe-avantgarde-demi-r-normal-*-*-140-*-*-p-*-iso8859-1"))) (set! templayer (car (gimp-text-fontname img drawable 0 offs txt2 border TRUE altezza PIXELS "URW Gothic L, Semi-Bold"))) (set! larg2 (car (gimp-drawable-width templayer))) (set! alte2 (car (gimp-drawable-height templayer))) (gimp-floating-sel-anchor templayer) (set! hcrop (max larg larg2)) (set! vcrop (+ offs alte2)) (gimp-brushes-set-brush "Circle (01)") (update-segment! segment 0 0 hcrop 0) (gimp-pencil drawable 4 segment) (update-segment! segment 0 0 0 vcrop) (gimp-pencil drawable 4 segment) (gimp-crop img hcrop vcrop 0 0) (file-pnm-save 1 img drawable outfile outfile 1))) (script-fu-register "script-fu-aonew-menu2hl" "/Xtns/Script-Fu/Misc/AO New Menu2 Hilite" "AO New Menu2" "Matteo Nastasi" "Matteo Nastasi" "2002-03-06" "" SF-VALUE "Border" "5" SF-VALUE "In meno" "5" SF-VALUE "Height" "14" SF-STRING "Text" "text" SF-STRING "Text" "text2" SF-FILENAME "Outfile" "outfile.pnm")