Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
echo -n "Dans votre vie, vous mangerez environ 30 000 kilos de nourriture, l’équivalent du poids de 6 éléphants." | convert -background black -fill white -font /usr/share/fonts/arial.ttf -size 465x101 -gravity Center caption:@- "output.jpg"
the output is :
As you can see, the "word" 000 has been cut in the middle, i.e. a breakline has been added in the middle of a word. This problem does not look specific to numbers as I've had the same problem with words with letters.
Caption can automatically size text to fit in a defined area but does not give you control over the placement of the text. Pango markup allows you to have control over the placement of text but does not do automatic font sizing.
ok so you are saying that caption does not really recognize words in the text and is going to insert a newline anywhere it likes (and not only where there is a space character)? That's what you mean when you say I can't control "placement of the text"?
But then how to explain that 95% of my texts have correct newlines (between words), and the behavior I report above is only in a minority of cases?
I'm puzzled because I have just tried again the code I posted above in my first message and the numbers aren't cut anymore. Can anyone try it and confirm if they can replicate the problem?
@bonzo : the problem happened with letters too
@magick : there was no space between the two numbers that were on separate lines, plus this happened with letters too (also not separated by a space)
@snibgo : what would this UTF character look like?
@snibgo : what would this UTF character look like?
It would look like a space. It is commonly used on web pages, coded as "& nbsp ;" (without the spaces). UTF contains a number of space characters for different purposes. From vague memory, a particular character is recommended for use as a thousands separator, such as your example.
@snibgo : what would this UTF character look like?
It would look like a space. It is commonly used on web pages, coded as "& nbsp ;" (without the spaces). UTF contains a number of space characters for different purposes. From vague memory, a particular character is recommended for use as a thousands separator, such as your example.
That should only work to replace a normal space with a non-breaking space in HTML. I doubt it would prevent an IM break in a set of consecutive zeros, such as 00000. It would also add a space there.
We added a patch to ImageMagick 6.3.0 that should resolve the problem. We won't break on digit followed by a number. 6.3.0-0 beta will be available sometime tomorrow.