convert -size 200x500 xc:none -font arial.ttf -pointsize 20 -fill 'SAMPLE TEXT' \
-stroke '#FF0000' -strokewidth 25 -draw 'text 30,60 'SAMPLE TEXT' \
-stroke none -draw 'text 30,60 'SAMPLE TEXT'\
output.png
i am using this code to create image of text. it is working fine but when i want new line in the text it is not working or when i type special character it gives me error as well.
The sample text value comes from textarea value.
I am also fred to give to text.
and please consider both the type i.e fred and above IM code
so please help regarding this..
use newline and special character in text
-
- Posts: 38
- Joined: 2010-12-14T03:56:10-07:00
- Authentication code: 8675308
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: use newline and special character in text
have you tried using double quotes and \n or \012 for new lines?
also it should work with label: rather than -draw or even caption: which will word wrap
see http://www.imagemagick.org/Usage/text/ and esp http://www.imagemagick.org/Usage/text/#label_vertical
also it should work with label: rather than -draw or even caption: which will word wrap
see http://www.imagemagick.org/Usage/text/ and esp http://www.imagemagick.org/Usage/text/#label_vertical
-
- Posts: 38
- Joined: 2010-12-14T03:56:10-07:00
- Authentication code: 8675308
Re: use newline and special character in text
Is it possible with label or caption that i can also apply font stroke and change shape using fred's. Please help me
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: use newline and special character in text
label: and caption: recognize -stroke for color and -stroke-width to change the thickness. I am not sure I understand about shape. If you refer to my script, texteffects, then label: and caption: are separate from those effects, but you can combine the shape things with label: and caption:, but you have to code each one separately for your self (or just use my script where that is what I have done). See http://www.imagemagick.org/Usage/text/ and http://www.imagemagick.org/Usage/fonts/
-
- Posts: 38
- Joined: 2010-12-14T03:56:10-07:00
- Authentication code: 8675308
Re: use newline and special character in text
yes ur right. i am using below code changing font shape, this is example of arc shape. is it possible with this that we can use single qoute(') in between the text or any other special character and newline is well.
./texteffect.sh -t "TEXT" -s outline -e arc-top -a 180 -f Arial -p 48 -c skyblue -b white -o black -l 1 -u lightpink
./texteffect.sh -t "TEXT" -s outline -e arc-top -a 180 -f Arial -p 48 -c skyblue -b white -o black -l 1 -u lightpink
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: use newline and special character in text
The ideal way to create a label of text AS IT IS. is put the text in a file or pipeline and feed it to the label using a '@' read from file escape. Any text iread in such a way will not be modified or have percent escapes expanded. Watch out for any final newline in the file or pipeline data, as that will also be used, AS IS, typically creating an extra blank line in the result.
http://www.imagemagick.org/Usage/text/#label_lines
http://www.imagemagick.org/Usage/text/#label_lines
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/