Page 1 of 1

Bengali Utf8 text to image conversion problem

Posted: 2010-06-13T15:31:14-07:00
by shiplu
This is the command I am using.

command:

Code: Select all

convert -background lightblue -fill blue -pointsize 48   -font /usr/share/fonts/truetype/freefont/FreeSans.ttf  label:@bn_utf8.txt  bn_label_utf8.gif
Font Name: FreeSans.ttf

Text: "অরুন্ধুতি রয়, সিরাজুদ্দৌলা, ঋতুপর্ণা"

Expected Output: (created by gimp)
Image


Actual Output: (created by convert utility)
Image

Why is this happening?
How to solve it?

Re: Bengali Utf8 text to image conversion problem

Posted: 2010-06-13T16:14:27-07:00
by magick
ImageMagick relies on the Freetype library to render text. Freetype is returning the same results as ImageMagick. Try
  • ftview -m 'অরুন্ধুতি রয়, সিরাজুদ্দৌলা, ঋতুপর্ণা' 48 /usr/share/fonts/truetype/freefont/FreeSans.ttf
We recommend submitting a bug report to the Freetype developers. If Freetype renders the text properly, ImageMagick will as well.

Re: Bengali Utf8 text to image conversion problem

Posted: 2010-06-13T16:22:31-07:00
by shiplu
magick wrote:ImageMagick relies on the Freetype library to render text. Freetype is returning the same results as ImageMagick. Try
  • ftview -m 'অরুন্ধুতি রয়, সিরাজুদ্দৌলা, ঋতুপর্ণা' 48 /usr/share/fonts/truetype/freefont/FreeSans.ttf
We recommend submitting a bug report to the Freetype developers. If Freetype renders the text properly, ImageMagick will as well.


Freetype and IM doesn't show same result. This is what I see,

Image

It seems IM can at least show some characters. But freetype can't.


GIMP can perfectly render images. What library it uses??

Re: Bengali Utf8 text to image conversion problem

Posted: 2010-06-13T17:12:40-07:00
by fmw42
what version of IM are you using and on what platform? if an old IM (or freetype), then try upgrading both.

Re: Bengali Utf8 text to image conversion problem

Posted: 2010-06-13T17:40:45-07:00
by magick
You're not setting up your ftview command properly. It looks like its rendering the text as latin-1 rather than unicode. When we use ftview we get the exact same results as ImageMagick.

Re: Bengali Utf8 text to image conversion problem

Posted: 2010-07-01T08:00:40-07:00
by shiplu
fmw42 wrote:what version of IM are you using and on what platform? if an old IM (or freetype), then try upgrading both.

I have used the most recent version. I just downloaded and compiled it.
magick wrote:You're not setting up your ftview command properly. It looks like its rendering the text as latin-1 rather than unicode. When we use ftview we get the exact same results as ImageMagick.
When Freetype library was not installed I used to see unicode characters as latin1.
Can you tell me the proper command? I have used the exactly same command you provided in the previous post.