It is currently Wed Aug 19, 2026 5:26 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 66 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject: Re: script request
PostPosted: Fri Jul 18, 2014 9:55 am  (#21) 
Offline
GimpChat Member
User avatar

Joined: Sep 22, 2012
Posts: 2089
Location: US
Graechan, you keep calling it a Ransom text script :hehe it's hilarious, and i don't mind it as long as you get it done :bigthup


Top
 Post subject: Re: script request
PostPosted: Fri Jul 18, 2014 1:15 pm  (#22) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
Graechan wrote:
how to change a string "text" to a list (t e x t),



(string->list "ABCD")

?

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: script request
PostPosted: Fri Jul 18, 2014 1:27 pm  (#23) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
Going just a step further than RobA's suggestion (since you will need strings for the PDB text functions):

=> (map (lambda (x) (make-string 1 x)) (string->list "ABCD"))
("A" "B" "C" "D")

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: script request
PostPosted: Fri Jul 18, 2014 6:46 pm  (#24) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
Thank you RobA and Saulgoode I now have all the necessary pieces of code to put it together for K1TesseraEna :yes

K1TesseraEna you will have your Ransom soon :rofl

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: script request
PostPosted: Sat Jul 19, 2014 2:58 am  (#25) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
K1TesseraEna
Image
or the script gets it :evil: :hehe

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: script request
PostPosted: Sat Jul 19, 2014 4:52 am  (#26) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5241
Location: Gimpville
Graechan wrote:
K1TesseraEna
Image
or the script gets it :evil: :hehe

:lol: :lol

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: script request
PostPosted: Sat Jul 19, 2014 5:05 am  (#27) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
GnuTux I have a few problems with it though,spaces seem to mess it up

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: script request
PostPosted: Sat Jul 19, 2014 11:48 am  (#28) 
Offline
GimpChat Member
User avatar

Joined: Sep 22, 2012
Posts: 2089
Location: US
:wh


Top
 Post subject: Re: script request
PostPosted: Sat Jul 19, 2014 12:03 pm  (#29) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5241
Location: Gimpville
Graechan wrote:
GnuTux I have a few problems with it though,spaces seem to mess it up

What's up with the spaces?.You should be able to check for spaces and handle accordingly. Are you placing each letter on its own layer?

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: script request
PostPosted: Sun Jul 20, 2014 2:09 am  (#30) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16164
Good one Graechan. :)

_________________
Image


Top
 Post subject: Re: script request
PostPosted: Sun Jul 20, 2014 2:11 am  (#31) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
GnuTux I finally have my spaces
Image

I don't think Muti-line text is within my grasp yet (but I'll start pondering now), biggest problem is that each letter is on it's own layer
the best I could do is set assign a SF-STRING for each line

ps Hi Rod

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: script request
PostPosted: Sun Jul 20, 2014 2:53 am  (#32) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5241
Location: Gimpville
Graechan wrote:
I don't think Muti-line text is within my grasp yet (but I'll start pondering now), biggest problem is that each letter is on it's own layer
the best I could do is set assign a SF-STRING for each line

When you grab the text layer as a string from SF-TEXT, carriage returns are included. You can use those to split the string into multiple lines.

> (gimp-text-layer-get-text text-layer)
("Line1\nLine2\nLine3")

Having each letter on its own layer provides versatility when positioning. ;)

Nice work, so far. Can't want to see what you come up with. :bigthup

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: script request
PostPosted: Sun Jul 20, 2014 3:35 am  (#33) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
I see what you mean, if I create a dummy text layer with all the text together, I could then extract each line individually to use in the script :bigthup

hopefully when I use (gimp-text-layer-get-text text-layer) the output can be used as individual strings

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: script request
PostPosted: Sun Jul 20, 2014 4:33 am  (#34) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5241
Location: Gimpville
That shouldn't be a problem...

>(map (lambda (x) (make-string 1 x)) (string->list (car (gimp-text-layer-get-text text-layer))))
("L" "i" "n" "e" "1" "\n" "L" "i" "n" "e" "2" "\n" "L" "i" "n" "e" "3")

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: script request
PostPosted: Sun Jul 20, 2014 5:04 am  (#35) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
I already use->(set! letterList (map (lambda (x) (make-string 1 x)) (string->list text))) ;create the list of letters

then extract letters one at a time with->(set! letter (car letterList))

if I then use (if (string=? letter "\n ") to identify when a new line should start

script should work OK :bigthup

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: script request
PostPosted: Sun Jul 20, 2014 5:38 am  (#36) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5241
Location: Gimpville
Yep. I'd say all you need to do is set text using..

(set! text (car (gimp-text-layer-get-text text-layer)))

or drop it inline and you're good to go. :cool

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: script request
PostPosted: Sun Jul 20, 2014 7:58 pm  (#37) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
I have my lines :yes
Image

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: script request
PostPosted: Sun Jul 20, 2014 8:39 pm  (#38) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5241
Location: Gimpville
:pengy :coolthup :jumpclap

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: script request
PostPosted: Sun Jul 20, 2014 9:00 pm  (#39) 
Offline
GimpChat Member
User avatar

Joined: Apr 08, 2010
Posts: 5420
Location: Northwest Ohio
Oy, my head is spinning trying to understand how this is all created with the script that I don't have a clue about, lol.


Top
 Post subject: Re: script request
PostPosted: Sun Jul 20, 2014 9:58 pm  (#40) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
2-ton wrote:
Oy, my head is spinning trying to understand how this is all created with the script that I don't have a clue about, lol.

The script has not even reached the Beta stage yet as I had hurdles to overcome and tests to do on the basic code for it
Thanks to RobA Saulgoode and GnuTux who have assisted

Now I have to add some finishing touches↓as in the 'm' and the 'p'
Image

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
Post new topic Reply to topic  [ 66 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC - 5 hours [ DST ]


cron

* Login  



Powered by phpBB3 © phpBB Group