Re: [Gimp-user] Script-fu : gimp-text-fontname and text variable

2006-09-20 Thread Sven Neumann
Hi,

On Wed, 2006-09-20 at 00:15 +0200, Nicolas wrote:

 I made a script-fu script, in which I write some text, using this
 syntax:
 
  (set! text-float (car (gimp-text-fontname img texteblanc 66 448
  text_to_write 0 1 34 0 FleurishScript Ultra-Light)))
 
 Photo is a variable :
 SF-VALUEtext_to_write )

It would help if you showed us the full script. From the snippets you
posted so far, I can only guess that you misunderstood the concept of
variable declaration in Script-Fu.


Sven


___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Script-fu : gimp-text-fontname and text variable

2006-09-20 Thread Nicolas
On Wed, Sep 20, 2006 at 06:03:33PM +0200, Nicolas MAUFRAIS wrote:
 On Wed, Sep 20, 2006 at 09:06:57AM +0200, Sven Neumann wrote:
  It would help if you showed us the full script. From the snippets you
  posted so far, I can only guess that you misunderstood the concept of
  variable declaration in Script-Fu.
  
  
  Sven
 
 I changed some things, but here it is:
 
 http://www.europephoto.com/info/bordure-titre-new.scm
 
 The functions do not work when I try to use the variables... :-/
 
 Thank you.
 
 Nicolas.


I really do not understand why the variables are taken from my script-fu
parameters window, and there's still an error:

Error while executing
(script-fu-titre 1 2 Texte 150 FleurishScript Ultra-Light 1 66 478)
ERROR: Invalid type for argument 3 to gimp_text_fontname

Here's the gimp-text-fontname function I use:
(gimp-floating-sel-anchor (car (gimp-text-fontname img -1 position_x
position_y text 0 TRUE size PIXELS font)))

The third argument is position_x

I defined my function like this:
(define (script-fu-titre text size font border position_x position_y)

What are the first and second variables? 1 and 2 ?
Where do they come from???

SF-IMAGE  Image 0
SF-DRAWABLE   Drawable  0
SF-STRING _TexteTexte
SF-ADJUSTMENT _Taille police (pixels)   '(150 2 1000 1 10 0 1)
SF-FONT   _Police   FleurishScript Ultra-Light
SF-VALUE _Epaisseur bordure1
SF-VALUE  _Position X   66
SF-VALUE  _Position Y   478)

Is it image and drawable?

Damn, Script-fu is driving me crazy ! All I need is to automate some
editing operations

Nicolas.
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Script-fu : gimp-text-fontname and text variable

2006-09-20 Thread Nicolas
On Wed, Sep 20, 2006 at 09:09:13PM +0200, Sven Neumann wrote:
 Hi,
 
 On Wed, 2006-09-20 at 20:15 +0200, Nicolas wrote:
 
  What are the first and second variables? 1 and 2 ?
  Where do they come from???
  
  SF-IMAGE  Image 0
  SF-DRAWABLE   Drawable  0
 
 I don't understand what you don't understand here. There's a list of
 parameters and image is the first one, drawable the second. Your
 function should of course handle this and accept image and drawable as
 the first parameters.
 
 If you don't need the active image and drawable, don't put your script
 into the Image menu then but register it with the Toolbox menu. You
 can then omit the two parameters.
 
 
 Sven

Sven,

You're right, the problem came from the positionning in Image instead
of Toolbox.

Thanks!

Nicolas.
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Script-fu : gimp-text-fontname and text variable

2006-09-19 Thread Nicolas
On Wed, Sep 20, 2006 at 12:15:26AM +0200, Nicolas MAUFRAIS wrote:
 Hello,
 
 I made a script-fu script, in which I write some text, using this
 syntax:
 
  (set! text-float (car (gimp-text-fontname img texteblanc 66 448
  text_to_write 0 1 34 0 FleurishScript Ultra-Light)))
 
 Photo is a variable :
 SF-VALUEtext_to_write )
 
 However, that does not work. I get the following error :
 
 ERROR: Invalid type for argument 5 to gimp_text_fontname
 
 Is there a way to print a variable with gimp_text_fontname?
 
 Thank you!
 Nicolas.

I changed
SF-VALUEtext_to_write )
to
SF-STRINGtext_to_write )

But I still get the same error... :-/

Nicolas.
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user