Page 1 of 1

Display \n in the text

Posted: 2006-06-06T07:34:57-07:00
by vav
How can I escape \n to show it in the text?
I was trying to double backslash, but it doesn't help.

Code: Select all

convert label:'test\\ntest' test.png
produces

Code: Select all

test\
then linebreak and

Code: Select all

test
on the second line.

Posted: 2006-06-06T11:07:23-07:00
by Bonzo
Your lucky vav as I can not get anything to do with text to work :cry:

Can you post your code or PM me a copy so I can see if it works on my server ?

Back to your question; I am not sure what you want to display. Do you want your label to say test \n test ?

Have you tried "test\ntest" instead of 'test\ntest' ?

Anthony

Posted: 2006-06-07T00:46:52-07:00
by vav
Yes, I'm trying to display text test\ntest.
I'm using IM 6.2.7 under linux.
I've tried:

Code: Select all

convert label:'test\ntest' test.png
convert label:'test\\ntest' test.png
convert label:"test\ntest" test.png
convert label:"test\\ntest" test.png
convert label:test\ntest test.png
convert label:test\\ntest test.png
In all cases I have linebreak instead of characters '\n'.

Posted: 2006-06-07T10:49:08-07:00
by Bonzo
I am afraid I can not help then vav.

The only other things I would try are:

1/ test/ntest - thats a laugh as the forum changed & # 4 7 ; to / ( I have added extra spaces to see if it will display )

2/ Try putting 'test\ntest' into a variable and use the variable in the convert comand instead.

Anthony