Page 1 of 1

caption word wrap problem in Chinese (UTF-8)

Posted: 2009-07-07T04:38:58-07:00
by secrectcode
Hi there,

I need to output an image with Chinese word, and wrap automatically inside a box.
This is how I do:

./convert -background black -fill white -font wts11.ttf -pointsize 20 -size 100x100 -encoding utf8 caption:"一二三四五六七八九十" caption.gif

The string after caption "一二三四五六七八九十" are Chinese words mean one to ten.

And the result I get
Image

Supposedly, the string 六七八九十 should on the second lines, but it seems not wrap at all.
I guess it's the same bug as
viewtopic.php?f=3&t=12923
For English, words are white space separated making word wrapping easy, in Chinese (and this is only a rough guess) each Chinese symbol can regarded as a word so word wrap can be done on either side of any Chinese symbol.
It seems that the bug is not solved. I'll upload the font later.
[updated: to reproduce this bug, you can download the font in http://cle.linux.org.tw/fonts/wangfonts/wts11.ttf
it's opensource font, free for download]

My im version is : ImageMagick 6.5.4-2 2009-07-06 Q16 OpenMP
OS: fedora

Re: caption word wrap problem in Chinese (UTF-8)

Posted: 2009-07-07T11:25:06-07:00
by magick
We have a patch for the problem you reported in ImageMagick 6.5.4-3 Beta available by sometime tomorrow. Thanks.

Re: caption word wrap problem in Chinese (UTF-8)

Posted: 2009-07-07T11:35:13-07:00
by secrectcode
magick wrote:We have a patch for the problem you reported in ImageMagick 6.5.4-3 Beta available by sometime tomorrow. Thanks.
Thanks for the quick response. I'm looking forwarding to getting the patch.
Thanks!