RSS/Atom feed Twitter
Site is read-only, email is disabled

Script-fu : gimp-text-fontname and text variable

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

7 of 7 messages available
Toggle history

Please log in to manage your subscriptions.

Script-fu : gimp-text-fontname and text variable Nicolas 20 Sep 00:15
  Script-fu : gimp-text-fontname and text variable Nicolas 20 Sep 00:30
  Script-fu : gimp-text-fontname and text variable Sven Neumann 20 Sep 09:06
   Script-fu : gimp-text-fontname and text variable Nicolas 20 Sep 18:03
    Script-fu : gimp-text-fontname and text variable Nicolas 20 Sep 20:15
     Script-fu : gimp-text-fontname and text variable Sven Neumann 20 Sep 21:09
      Script-fu : gimp-text-fontname and text variable Nicolas 20 Sep 22:57
Nicolas
2006-09-20 00:15:26 UTC (over 17 years ago)

Script-fu : gimp-text-fontname and text variable

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-VALUE "text_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.

Nicolas
2006-09-20 00:30:48 UTC (over 17 years ago)

Script-fu : gimp-text-fontname and text variable

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-VALUE "text_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-VALUE "text_to_write" "")
to
SF-STRING "text_to_write" "")

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

Nicolas.

Sven Neumann
2006-09-20 09:06:57 UTC (over 17 years ago)

Script-fu : gimp-text-fontname and text variable

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-VALUE "text_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

Nicolas
2006-09-20 18:03:33 UTC (over 17 years ago)

Script-fu : gimp-text-fontname and text variable

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.

Nicolas
2006-09-20 20:15:29 UTC (over 17 years ago)

Script-fu : gimp-text-fontname and text variable

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 _"Texte" "Texte" SF-ADJUSTMENT _"Taille police (pixels)" '(150 2 1000 1 10 0 1) SF-FONT _"Police" "FleurishScript Ultra-Light" SF-VALUE _"Epaisseur bordure" "1" 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.

Sven Neumann
2006-09-20 21:09:13 UTC (over 17 years ago)

Script-fu : gimp-text-fontname and text variable

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 menu. You can then omit the two parameters.

Sven

Nicolas
2006-09-20 22:57:20 UTC (over 17 years ago)

Script-fu : gimp-text-fontname and text variable

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 menu. You can then omit the two parameters.

Sven

Sven,

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

Thanks!

Nicolas.