Page 1 of 1

Caption not wordwrapping correctly

Posted: 2012-05-18T21:37:50-07:00
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.

Re: Caption not wordwrapping correctly

Posted: 2012-05-19T08:00:10-07:00
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.

Re: Caption not wordwrapping correctly

Posted: 2012-05-19T09:27:00-07:00
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.

Re: Caption not wordwrapping correctly

Posted: 2012-05-19T20:42:26-07:00
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

Re: Caption not wordwrapping correctly

Posted: 2012-05-19T21:59:36-07:00
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.

Re: Caption not wordwrapping correctly

Posted: 2012-05-19T22:16:50-07:00
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

Re: Caption not wordwrapping correctly

Posted: 2012-05-19T22:22:50-07:00
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?

Re: Caption not wordwrapping correctly

Posted: 2012-05-20T12:02:14-07:00
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.

Re: Caption not wordwrapping correctly

Posted: 2012-05-20T17:44:09-07:00
by alasdairdf
That's great!

Which bug did you fix: the wordwrap or the unable to load font?

Re: Caption not wordwrapping correctly

Posted: 2012-05-20T17:52:18-07:00
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.

Re: Caption not wordwrapping correctly

Posted: 2012-05-21T06:27:59-07:00
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!