;after processing, maps are created in the output file, but you still have
;to mapipulate the final 4 lines into 2 halves and place each in each map,
;and add the urls you have in mind into them.
;Caolan McNamara (1998) caolan@skynet.ie
; Define the function:
(define (script-fu-text-test inFile inFile2 inFont inFontSize inTextColor inFont2 inFontSize2 inTextColor2 inIndent inTitle inFont3 inFontSize3 inTextColor3 inTextColor4 inMaxHeight)
(let*
(
; define our local vars
; create a new image:
(seg (cons-array 4 'double))
(theImageWidth 10)
(theImageHeight 10)
(theImageWidth2 10)
(theImageHeight2 10)
(theImage (list (car (gimp-image-new theImageWidth theImageHeight RGB) ) (car (gimp-image-new theImageWidth theImageHeight RGB) ) (car (gimp-image-new theImageWidth theImageHeight RGB) ) ))
(theImage2)
(theText)
(theFile)
(theFile2)
(theLine)
(theChar)
(linewidth)
(lineheight)
(linewidth2)
(lineheight2)
(linewidth3)
(lineheight3)
(anindent 10)
(anotherindent (list 10))
(anotherindent2)
(anotherindent3)
(theTextList)
(thetextindent)
(tempindent1)
(temptextlist)
(value)
(value2)
(theextra "1")
(alist)
(blist)
(clist)
(dlist)
(elist)
(offsets)
; create a new layer for the image:
(theLayer (list (car (gimp-layer-new (car theImage) theImageWidth theImageHeight RGB_IMAGE "layer 1" 100 NORMAL)) (car (gimp-layer-new (car (cdr theImage)) theImageWidth theImageHeight RGB_IMAGE "layer 1" 100 NORMAL)) (car (gimp-layer-new (car (cdr theImage)) theImageWidth theImageHeight RGB_IMAGE "layer 1" 100 NORMAL) )))
(theLayer2)
)
; add the new layer to the image:
(set! theImage2 theImage)
(set! theLayer2 theLayer)
(gimp-image-add-layer (car theImage) (car theLayer) 0)
; now, set the background and foreground colors:
(gimp-palette-set-background '(255 255 255) )
(gimp-palette-set-foreground inTextColor)
; clear the canvas:
(gimp-selection-all (car theImage))
(gimp-edit-clear (car theImage) (car theLayer))
(gimp-selection-none (car theImage))
(set! theImageWidth 0)
(set! theImageHeight 0)
(set! theChar "X")
(set! theLine "")
(set! theFile2 (fopen inFile2 "w"))
(fwrite "\n\n" theFile2)
(fwrite "" theFile2)
; display our image:
(gimp-display-new (car theImage))
; reset the dirty flag:
(gimp-image-clean-all (car theImage))
(set! linewidth (append linewidth (list 0)))
(set! lineheight (append lineheight (list 0)))
(set! anotherindent (append anotherindent (list 10 50 10)))
(set! lineheight2 lineheight)
(set! linewidth2 linewidth)
(set! anotherindent2 anotherindent)
(set! value2 0)
(set! theTextList (append theTextList (list "arse" )))
(while (not (= (cdr theImage2) ()))
(gimp-image-resize (car theImage2) (+ 20 theImageWidth2) theImageHeight2 10 0)
(gimp-layer-resize (car theLayer2) (+ 20 theImageWidth2) theImageHeight2 10 0)
(script-fu-border (car anotherindent) (car theImage2) (car theLayer2) theImageWidth2 theImageHeight2 (car lineheight) (car linewidth) seg)
(set! lineheight3 lineheight2)
(set! linewidth3 linewidth2)
(set! anotherindent3 anotherindent2)
(set! tempindent1 thetextindent)
(set! temptextlist theTextList)
(set! value 0)
(while (not (= (cdr lineheight3) ()))
(script-fu-box (car anotherindent3) (car theImage2) (car theLayer2) (car lineheight3) (car linewidth3) seg)
(if (= value value2)
(gimp-palette-set-foreground inTextColor3)
(gimp-palette-set-foreground inTextColor4)
)
(set! theText (car (gimp-text (car theImage2) (car theLayer2) (+ 10 (car tempindent1)) 3 (car temptextlist) 0 TRUE inFontSize3 PIXELS "*" inFont3 "*" "*" "*" "*")))
(set! offsets (gimp-drawable-offsets theText))
(fwrite "string (+ 10 (car offsets))) theFile2)
(fwrite "," theFile2)
(fwrite (number->string (cadr offsets)) theFile2)
(fwrite "," theFile2)
(fwrite (number->string (+ 10 (+ (car (gimp-drawable-width theText)) (car offsets)))) theFile2)
(fwrite "," theFile2)
(fwrite (number->string (+ (car (gimp-drawable-height theText)) (cadr offsets))) theFile2)
(fwrite "\" href=\"CHANGEME\">\n" theFile2)
(set! tempindent1 (cdr tempindent1))
(set! lineheight3 (cdr lineheight3))
(set! linewidth3 (cdr linewidth3))
(set! anotherindent3 (cdr anotherindent3))
(set! temptextlist (cdr temptextlist))
(set! value (+ 1 value))
)
(set! theImage2 (cdr theImage2))
(set! theLayer2 (cdr theLayer2))
(set! linewidth (cdr linewidth))
(set! lineheight (cdr lineheight))
(set! anotherindent (cdr anotherindent))
(set! value2 (+ 1 value2))
)
(fclose theFile2)
))
; Register the function with the GIMP:
(define (script-fu-border indent inImage inLayer inWidth inHeight linex liney segment)
(set! inWidth (+ inWidth 20))
(gimp-palette-set-foreground '(0 0 0))
(gimp-brushes-set-brush "Circle (01)")
(aset segment 0 0.0)
(aset segment 1 linex)
(aset segment 2 0.0)
(aset segment 3 liney)
(gimp-pencil inImage inLayer 4 segment)
(aset segment 0 0)
(aset segment 1 linex)
(aset segment 2 0)
(aset segment 3 inHeight)
(gimp-pencil inImage inLayer 4 segment)
(aset segment 0 0.0)
(aset segment 1 linex)
(aset segment 2 indent )
(aset segment 3 linex)
(gimp-pencil inImage inLayer 4 segment)
(aset segment 0 (+ 3 (+ indent liney)))
(aset segment 1 linex)
(aset segment 2 inWidth)
(aset segment 3 linex)
(gimp-pencil inImage inLayer 4 segment)
(aset segment 0 (- inWidth 1))
(aset segment 1 linex)
(aset segment 2 (- inWidth 1))
(aset segment 3 inHeight)
(gimp-pencil inImage inLayer 4 segment)
)
(define (script-fu-box indent inImage inLayer linex liney segment)
(aset segment 0 indent)
(aset segment 1 0.0)
(aset segment 2 indent)
(aset segment 3 linex)
(gimp-pencil inImage inLayer 4 segment)
(aset segment 0 (+ 3 (+ indent liney)))
(aset segment 1 0.0)
(aset segment 2 (+ 3 (+ indent liney)) )
(aset segment 3 linex)
(gimp-pencil inImage inLayer 4 segment)
(aset segment 0 indent)
(aset segment 1 0.0)
(aset segment 2 (+ 3 (+ indent liney)) )
(aset segment 3 0.0)
(gimp-pencil inImage inLayer 4 segment)
)
(script-fu-register
"script-fu-text-test"
"/Xtns/Script-Fu/Text/homelist"
"Creates superduper list for my home page http://www.csn.ul.ie/~caolan"
"Caolan McNamara"
"1998, Caolan McNamara"
"August 25, 1998"
""
SF-VALUE "In File Name:" "\"/home/caolan/gimplist\""
SF-VALUE "Out File Name:" "\"/home/caolan/gimplist.html\""
SF-VALUE "Font:" "\"urw palladio l\""
SF-VALUE "Font size:" "12"
SF-COLOR "Color:" '(51 102 102)
SF-VALUE "Font2:" "\"dragonwick\""
SF-VALUE "Font size2:" "13"
SF-COLOR "Color2:" '(102 102 102)
SF-VALUE "Indent:" "35"
SF-VALUE "Title:" "\"List \""
SF-VALUE "Font3:" "\"urw chancery l\""
SF-VALUE "Font size3:" "18"
SF-COLOR "Color3:" '(102 102 102)
SF-COLOR "Color4:" '(153 153 153)
SF-VALUE "Max Height:" "350"
)