Caption not wordwrapping correctly

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
alasdairdf
Posts: 53
Joined: 2012-05-15T04:56:50-07:00
Authentication code: 13

Caption not wordwrapping correctly

Post by alasdairdf »

viewtopic.php?f=1&t=21043

IM version: ImageMagick 6.7.6-9 2012-05-16 Q16
OS: CentOS 6.2 64-bit

The following code does not wrap the text:

Code: Select all

convert -limit thread 1 -background transparent -colorspace CMYK -font "smallcaps.otf" +pointsize -size 1335x806 -gravity center -fill "rgb(28,22,17)" caption:"Essays on the Drama, Edited With an Introduction and Notes" -trim -write working.mpc -format "%wx%h" info:-
For most sentences it will wrap nicely, but for some, such as the example given here "Essays on the Drama, Edited With an Introduction and Notes", the whole title is on one line and difficult to read because of this, with a lot of white space above and below when I position it centered in the 1335x806 space for which it is intended.

For an example of what it looks like in the final image, see here:
http://us-fs.forgottenbooks.org/image.p ... 1000005673

For most sentences it looks nice, like this:
http://us-fs.forgottenbooks.org/image.p ... 1000004148

Older versions of IM did not have this problem (but had another problem where sometimes words would be wrapped onto the next line, which was even worse).

This only occurs on 1/100 sentences, and any change in font changes whether this happens because its dependent on the particular combinations of words, letters and their sizes, which changes when this issue occurs.

I have temporarily uploaded the font for testing to:
http://www.forgottenbooks.org/smallcaps.otf
I don't think it's a font issue, but there it is for you to check.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Caption not wordwrapping correctly

Post by magick »

We need to reproduce the problem before we can help. Unfortunately we do not have smallcaps.otf. Instead we used Fontin-SmallCaps.otf and the text rendered properly. We're using ImageMagick 6.7.7-0, the latest ImageMagick release.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Caption not wordwrapping correctly

Post by fmw42 »

It is your version of smallcaps.otf. It fails for me with IM 6.7.6.10 Q16 Mac OSX Snow Leopard. But the font I downloaded from http://www.diglo.com/download/free/6c13 ... e2266203ea works just fine.
alasdairdf
Posts: 53
Joined: 2012-05-15T04:56:50-07:00
Authentication code: 13

Re: Caption not wordwrapping correctly

Post by alasdairdf »

It is your version of smallcaps.otf. It fails for me with IM 6.7.6.10 Q16 Mac OSX Snow Leopard. But the font I downloaded from http://www.diglo.com/download/free/6c13 ... e2266203ea works just fine.
It's not that font. But anyway, I remember that I converted the font ages ago from postscript to otf with fontforge or one of those, so that could have been why it is messing up.

Now I have purchased brand new and shiny OTF fonts, fresh from linotype with no modifications, but for all of them IM throws an error, please see:
viewtopic.php?f=1&t=21050&p=85246
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Caption not wordwrapping correctly

Post by fmw42 »

All I can suggest is to post one of those new fonts, so that the IM developers can test using the very same font.
alasdairdf
Posts: 53
Joined: 2012-05-15T04:56:50-07:00
Authentication code: 13

Re: Caption not wordwrapping correctly

Post by alasdairdf »

Here is one of the fonts that does not load in IM. It's free for personal use, so should be no problems with my linking to it here:
http://www.forgottenbooks.org/NewOldEnglish.otf
alasdairdf
Posts: 53
Joined: 2012-05-15T04:56:50-07:00
Authentication code: 13

Re: Caption not wordwrapping correctly

Post by alasdairdf »

Also, magick, I did upload the original font which was not wordwrapping correctly. It's here:
http://www.forgottenbooks.org/smallcaps.otf

Could you please check that too, and see if the bug is in IM or some kind of mistake in the font boundaries?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Caption not wordwrapping correctly

Post by magick »

We can reproduce the problem you reported and have a patch. Look for it in ImageMagick-6.7.7-1 Beta by sometime tomorrow. Thanks.
alasdairdf
Posts: 53
Joined: 2012-05-15T04:56:50-07:00
Authentication code: 13

Re: Caption not wordwrapping correctly

Post by alasdairdf »

That's great!

Which bug did you fix: the wordwrap or the unable to load font?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Caption not wordwrapping correctly

Post by magick »

Wordwrap. We had no problem loading your two fonts. We're using ImageMagick 6.7.7-1 Beta and Freetype 2.4.8-3.
alasdairdf
Posts: 53
Joined: 2012-05-15T04:56:50-07:00
Authentication code: 13

Re: Caption not wordwrapping correctly

Post by alasdairdf »

OK, that's perfect. The issue with the new fonts appeared to be because I renamed them! Strange behavior. But anyway, I've decided I like the old fonts afterall. Thank you!
Post Reply