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: 11076
Joined: 2003-05-31T11:32:55-07:00

Post by magick » 2006-04-03T09:20:31-07:00

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: 11076
Joined: 2003-05-31T11:32:55-07:00

Post by magick » 2006-04-03T11:25:42-07:00

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: 11076
Joined: 2003-05-31T11:32:55-07:00

Post by magick » 2006-04-03T13:27:37-07:00

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: 11076
Joined: 2003-05-31T11:32:55-07:00

Post by magick » 2006-04-05T09:17:38-07:00

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