First I suggest you re-think the order of your operations.
-resample for example is an operator that works on an actual image! As such it at least should be AFTER the caption:
Also -density and -resample combination is not really required for caption, but for postscript pdf and other vector images. Text drawing is handles find without needing them.
The same goes for -rotate 0 which actually does nothing!
Simplifying the problem....
Code: Select all
convert -gravity west -size 100x \
caption:"This is a long sentance that should need word-wrapping" \
text_caption.png
Code: Select all
convert -gravity east -size 100x \
caption:"This is a long sentance that should need word-wrapping" \
text_caption_east.png
Code: Select all
convert -gravity north -size 100x \
caption:"This is a long sentance that should need word-wrapping" \
text_caption_north.png
Well that shows that the caption is handling the 'gravity' justification setting appropriately.
Vertically too if you 'fix' the optional height of the caption box size.