Hi Rory -
There is a text along path script (actually, there are to of 'em).
Unfortunately, I don't remember just where I got them, so they are included
here as two attachments. Just drop them into your .gimp-1.2/scripts directory
and take it from there. Better read them first, though, to find out the
instructions.
--
--Jeff
Jeff Trefftzs <[EMAIL PROTECTED]>
http://www.tcsn.net/trefftzsHome Page
http://gug.sunsite.dk/gallery.php?artist=68 Gimp Gallery
http://trefftzs.topcities.com/ Photo Gallery
;;;Script written by Guillaume de Sercey
;;;[EMAIL PROTECTED]
;;;What it does: writes a text following a path
;;;How does it do it:
;;;-creates an empty text layer
;;;-prints the text a letter at a time in a new layer (with the freetype plug-in)
;;;-gets a point along a path with its gradient (gimp-path-get-point-at-dist)
;;;-transform the gradient in a angle (script-fu-path-get-point-at-dist does this
together with the previous step)
;;;-rotate the character layer by the angle (rotation around the top-left corner)
;;;-move the character layer at the position of the point on the path
;;;-merge the character layer with the text layer
;;;-repeat until a characters ahave been printed
;;;I use the freetype plug-in because it is the only text function that always align
letters
;;;The *catch function is here in case the text is longer than the path
;;;It avoids getting an error from gimp-path-get-point-at-dist
;;;However it will also ignore any other error in the *catch form
;;;In particular, errors caused by an invalid fontname for freetype
;;;I've worked around that by using freetype to create the base text layer (a space
character), before the catch
;;;Note: it is best to modify the argument of SF-FILENAME to match a valid font on
your system
;;;Or at least a valid directory
;;;Saves a lot of browsing
;;; Changelog. 20011120 Jeff changed it to use SF-FONT vice SF-FILE for
;;; Font Selection
(define (script-fu-path-get-point-at-dist img position);a variation on
gimp-path-get-point-at-dist where the last argument is the angle not the gradient
(let*
(
(delta .1)
(deltastart .2)
(point (gimp-path-get-point-at-dist img position))
(angle (atan (caddr point)));this return an angle between [-pi,+pi] and
needs to be adjusted
(point1 (butlast (gimp-path-get-point-at-dist img (- position deltastart
(point2 (butlast (gimp-path-get-point-at-dist img (+ position deltastart
); end declare
(while (equal? point1 point2)
(set! deltastart (+ deltastart delta))
(set! point1 (butlast (gimp-path-get-point-at-dist img (- position
deltastart
(set! point2 (butlast (gimp-path-get-point-at-dist img (+ position
deltastart
)
(if (= (car point1) (car point2));if x coords are equal
(if (< angle 0) ;and angle negative
(if (< (cadr point1) (cadr point2));then if point1 is below point2
(set! angle (+ *pi* angle));add pi to the angle otherwise do
nothing
) ;end true of angle negative
(if (> (cadr point 1) (cadr point2));angle is positive. if point1 is
above point2
(set! angle (+ *pi* angle));add pi to the angle otherwise do
nothing
) ;end false of angle negative
) ;end if angle, end true of x coords equal
(if (< (car point2) (car point1))
(set! angle (+ *pi* angle))
) ;end if point, end false of x coords equal
) ;end if x coords equal
(list (car point) (cadr point) angle)
)
)
;;; Here's the actual script
(define (script-fu-text-to-path2 img drw text font
fontsize spacing
antialiasing no-upsidedown)
(if (= 0 (car (gimp-path-list img)))
(gimp-message "This script needs a path!")
(begin;there is a path let's go
(let*
(
(path (car (gimp-path-get-current img)))
(textlen (length text))
(typea (car (gimp-drawable-type-with-alpha drw)))
;(text-layer (car (plug-in-freetype RUN-NONINTERACTIVE img 0 fontfile
fontsize PIXELS 1 0 0 1 FALSE FALSE FALSE FALSE 0 " ")))
(text-layer
(car
(gimp-layer-new img
(car (gimp-image-width img))
(car (gimp-image-height img))
typea
"Text Layer"
100
NORMAL-MODE)))
<@ (char-layer) ; what's this???
(charac "!");a 1 character-long string
(position 0)
(charcount 0)
(charwidth)
);end variable declaration
(if (= text-