;;; Plugin  : Text Embroider
;;; Author  : Rod Detmer
;;; Date    : August 3rd 2012
;;; Revision: 2.0
;;; 					
;;; Version : 2.1
;;; Latest version at: http://www.gimpchat.com
;;; Required : Gimp 2.8 or later
;;;
;;; Description: 
;;; Creates an embroidery effect on your text layer
;;; -----------------------------------------------------------------------------
;;; Change Log:
;;; Version-2.1
;;; Fix bevel error
;;;
;;; License:
;;; 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-text-embroider image layer bevel shadowx shadowy StitchDir StitchSpacingDir)
  (gimp-image-undo-group-start image)
  (plug-in-ripple RUN-NONINTERACTIVE image layer 2 3 StitchDir 1 1 TRUE FALSE)
  (script-fu-drop-shadow image layer 1 1 5 '(0 0 0) 80 0)
  (script-fu-erase-rows image layer StitchSpacingDir 0 0)
  (plug-in-ripple RUN-NONINTERACTIVE image layer 3 1 StitchDir 1 1 TRUE FALSE)
  (gimp-brightness-contrast layer -32 91)
  (script-fu-add-bevel image layer bevel 0 0)
  (script-fu-drop-shadow image layer shadowx shadowy 5 '(0 0 0) 80 0)
   
  (gimp-displays-flush image)
  (gimp-image-undo-group-end image)  
)

(script-fu-register
 "script-fu-text-embroider"
 "<Image>/Script-Fu/Rod/Artistic/Text Embroider"
 "creates a embroidery effect on text layers"
 "Rod Detmer"
 "Rod Detmer"
 "August 2012" 
 "RGB* GRAY* INDEXED*"
 SF-IMAGE "The Image" 0
 SF-DRAWABLE "The Layer" 0
 SF-ADJUSTMENT "Bevel" '(3 0 30 1 10 0 SF-SLIDER)
 SF-ADJUSTMENT "Shadow X" '(2 0 1000 1 10 0 SF-SPINNER)
 SF-ADJUSTMENT "Shadow Y" '(2 0 1000 1 10 0 SF-SPINNER)
 SF-OPTION "StitchDir" '("Horizontal" "Vertical")
 SF-OPTION "StitchSpacingDir" '("Horizontal" "Vertical")
) 
