Page 1 of 1

Add multiple lines of text

Posted: Wed Jan 06, 2021 4:43 pm
by wonzling
Hello, i want to add some text to an foto with this:

Code: Select all

C:\Users\XXXXXX\Desktop\NConvert>nconvert -canvas #1 #500 top-center -bgcolor 255 005 255 -ratio -rtype lanczos  -text_font "Arial" 100 -text_color 0 0 0 -text_flag bottom-center -text_pos 0 -400 -text_rotation 0 -text "Hello Test" TEST.jpg
This code works perfect.
Now i want the text under the image in two lines:

Hello
Test

I have tried to export from XNView MP but also this not works ...
Can someone help me?
Thanks

Re: Add text

Posted: Wed Jan 06, 2021 5:46 pm
by cday
The problem, ignoring all the other details, is how to use the -text option to insert two lines of text, if that is actually possible?

In XnView MP Batch convert (or XnConvert) pressing the 'Enter' key creates a second text line in the image preview, and the exported code has a line break at that point, have you tested what happens if you put a line break in your code, quite possibly nothing?

If a line break in the code doesn't work, I'm not sure whether there is any other character that might be recognised as a line break?

If those possibilities don't work, my only immediate suggestion would be to write the two lines in separate lines of code.

Re: Add multiple lines of text

Posted: Wed Jan 06, 2021 7:51 pm
by cday
Update:

I've now tested with a line break ('Enter') in the code line, and not surprisingly the code doesn't run.

So the only solution would seem to be to use two lines of code, to write first one line of text, then the second one below.

@Pierre: Is there any way to write two lines of text using one line of code, to force a new line?

Text_1
Text_2

Re: Add multiple lines of text

Posted: Thu Jan 07, 2021 10:47 am
by wonzling
cday wrote: Wed Jan 06, 2021 7:51 pm Update:

I've now tested with a line break ('Enter') in the code line, and not surprisingly the code doesn't run.

So the only solution would seem to be to use two lines of code, to write first one line of text, then the second one below.

@Pierre: Is there any way to write two lines of text using one line of code, to force a new line?

Text_1
Text_2
thank you for your reply. Also I have only the Idea with two lines of code ... But if @Piere have an solution ...

Re: Add multiple lines of text

Posted: Fri Jan 08, 2021 10:11 am
by xnview
wonzling wrote: Thu Jan 07, 2021 10:47 am thank you for your reply. Also I have only the Idea with two lines of code ... But if @Piere have an solution ...
No, but i'll add in next version \n as new line character...

Re: Add multiple lines of text

Posted: Fri Jan 08, 2021 4:39 pm
by wonzling
@Piere. OK thank you.
A suggestion: start nconvert with the XBS from XNVIEW MP. This would be nice.
Like:
nconvert -Test.xbs
:D

Re: Add multiple lines of text

Posted: Sat Jan 09, 2021 7:39 am
by xnview
wonzling wrote: Fri Jan 08, 2021 4:39 pm @Piere. OK thank you.
A suggestion: start nconvert with the XBS from XNVIEW MP. This would be nice.
Like:
nconvert -Test.xbs
:D
And what about xnconvert test.xbs?

Re: Add multiple lines of text

Posted: Wed Jan 13, 2021 8:44 am
by Peter2
xnview wrote: Fri Jan 08, 2021 10:11 am No, but i'll add in next version \n as new line character...
Fine - I'm just looking for it too.

@Xnview:
Do you already know when you will release the next version?