Incorrect word-wrapping with Caption: ?

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?".
Post Reply
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

Instead of rendering the actual characters to see if they can fit on one line we use the max advance metric instead which is a worst case scenario (most characters do not need the max advance width). Its faster but not as accurate as rendering the actual text and checking bounds. You of course can modify coders/caption.c to suit your needs.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

Well sure, we rely on the font metrics returned about the font. If the metrics are unreliable it could affect the word splits in the caption.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

ImageMagick grabs the metrics directly from the font file. We have no reason at this time to believe the metrics are unreliable. As suggested the problem is most likely simply that we speed up the process by using the max advance metric instead of using the slower method of getting the actual advance metric for each character.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

The problem is that even the first word cannot be placed within the width of the image canvas so the algorithm bails. We can improve the algorithm to take "do the best you can" approach. Will have a patch in ImageMagick 6.2.7 Beta within a few days.
Post Reply