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?".
I often use label: just to get the image size desired. The rewrite with -annotate. You can also get font metrics with label: or annotate or draw using -debug annotate. See http://www.imagemagick.org/Usage/text/#font_info
If you want to change the spacing, just add -splice after each -trim to add a slight amount of background color to one side or the other. Or use -border to add half to each left/right side and not the top.
You can use snibgo's method to get the character size from the trimmed image and then adjust it. You would have to script a loop over each image after trimming to get the dimensions and offsets and then modify it with -set page. Then use -layers merge to combine them.
Actually you can loop over each character and just get the page geometry using string format %@. Then when actually creating the letter images in snibgo's command use -set page based upon the dimensions and offsets from the string format.
Actually, I don't think you need to know anything about the character size. You can just use -set page +X+Y to adjust the trimmed images to offset them as desired, one character at a time.
fmw42 wrote:Actually, I don't think you need to know anything about the character size. You can just use -set page +X+Y to adjust the trimmed images to offset them as desired, one character at a time.
That is what I want to do but I need to know in advanced what will be each character size, right?
Why do you need the size, if all you want to do is put space between them. But if you need to adjust vertically, then you probably do need the size. You can get that by making a pass over each letter without creating it by using the string format "%@" and storing the size and offsets in an array. Then read the array when actually creating the letters and adjust the offsets as needed. See my post above and http://www.imagemagick.org/script/escape.php