Bengali Utf8 text to image conversion problem

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
shiplu

Bengali Utf8 text to image conversion problem

Post 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?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Bengali Utf8 text to image conversion problem

Post 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.
shiplu

Re: Bengali Utf8 text to image conversion problem

Post 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??
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Bengali Utf8 text to image conversion problem

Post by fmw42 »

what version of IM are you using and on what platform? if an old IM (or freetype), then try upgrading both.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Bengali Utf8 text to image conversion problem

Post 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.
shiplu

Re: Bengali Utf8 text to image conversion problem

Post 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.
Post Reply