Page 1 of 1

IM 6.54 - Hindi text rendering - ligatures not joining

Posted: 2009-08-20T04:16:04-07:00
by tomleitch
Hi all,

We've come across a little problem with IM 6.54 and Hindi characters (did this on OS X) in which characters which when typed together should form a single character, are being rendered as separate characters - the ligatures are not joining. I have created an image which demonstrates the problem, but am not sure where to go from here. I suspect other languages (which we work with) such as Urdu would suffer from the very same problem. I'm not sure how well phpBB deals with UTF-8 but here goes - these are the actual offending characters "केंद्रों". If not, then the sample is from this page http://www.bbc.co.uk/hindi/southasia/20 ... g_vv.shtml, 10th paragraph, 5th word from the end of the last sentence.

The font we're using is called Mangal and is available here: http://www.bbc.co.uk/hindi/fontinstall/mangal.ttf

Image

Any pointers or assistance greatly appreciated.

Best,
tom

Re: IM 6.54 - Hindi text rendering - ligatures not joining

Posted: 2009-08-20T20:26:43-07:00
by anthony
This will be a problem in the freetype library which IM uses for rendering.

IM just passes the data to the library, which renders the image.

Re: IM 6.54 - Hindi text rendering - ligatures not joining

Posted: 2009-08-21T02:32:22-07:00
by tomleitch
Hey Anthony, thanks - should have guessed really. I'll file something over with those guys. For the sake of the web - here is that submission: https://savannah.nongnu.org/bugs/index. ... 9#attached

tom

Re: IM 6.54 - Hindi text rendering - ligatures not joining

Posted: 2009-08-21T05:59:34-07:00
by anthony
You may like to give the version of the freetype library that is installed and being used.

Let them know it is freetype or they may think it is a ImageMagick problem.

Re: IM 6.54 - Hindi text rendering - ligatures not joining

Posted: 2009-08-21T08:01:02-07:00
by magick
It does look like a problem with the font for the Freetype library. Try ftview, a freetype demo program. It returns the same incorrect results as ImageMagick.

Re: IM 6.54 - Hindi text rendering - ligatures not joining

Posted: 2009-09-06T12:15:00-07:00
by raviop531
Freetype developers are simply wiping off their hands from this.I am facing the same issue which hasn't been resolved yet ; inspite of trying various alternative.

Surprisingly it worked on a Cent OS Distro installed in our office, however we haven't been able to reproduce it work on any other machine.

I hope the forum member and developers would have some answers to this

Re: IM 6.54 - Hindi text rendering - ligatures not joining

Posted: 2009-09-06T19:01:42-07:00
by anthony
It may be that the older freetype library that is on CentOS worked.

Compared to later Linux's CentOS is anchient. It is designed for use in servers, and as such they only want to use software that have been known to work without serious bugs for a long time. Hence, older software revisions.

Check the freetype library version numbers.

Re: IM 6.54 - Hindi text rendering - ligatures not joining

Posted: 2009-09-07T01:12:31-07:00
by raviop531
Thanks a ton Anthony

There is something very interesting I want to share.Kindly have a look at the configuration bellow.

[1]Cent OS 5.2
[2]Ghost script 8.15
[3]libfreetype.so.6.3.10
[4] Imagemagick 6.2

the ligature joining was working perfectly fine(except for text wrapping) until I upgraded to Imagemagick to 6.5.5. Now I am facing the same issue with ligature joining.I installed the application from the source file {./configure,make,make install}.

My question here is simple , do the freetype and ghost script library come along with the imagemagick source (i guess no)? If the answer is no , then Imagemagick should be using the existing versions of the libraries to render the text.If such is the case then I do not see an issue with freetype or gs


I do not intend to crib about the issue,however we wanted to use this feature for a very noble cause , I hope someone in the community addresses this.


Thanks
Awaiting Feedback

Re: IM 6.54 - Hindi text rendering - ligatures not joining

Posted: 2009-09-07T02:53:44-07:00
by tomleitch
I filed a bug with the Freetype people but they told me this:
FreeType doesn't handle the ligature forming process. This is done one level higher by libraries like Qt, Pango, or ICU.
FreeType simply receives a glyph index, and it returns a rendered image of that glyph; this process is executed after ligature forming has been done.

So I should try filing the bug with the Pango team.... would really love to get this working.

tom

Re: IM 6.54 - Hindi text rendering - ligatures not joining

Posted: 2009-09-09T03:26:54-07:00
by raviop531
I can conclude that the issue is not with Imagemagick but with freetype or other such libraries,
I tried using gd library{php} and the result is the same.

Not only that , I had painstakingly installed PIL (Python Imaging library) for this purpose , however the ligature issue persists.

Re: IM 6.54 - Hindi text rendering - ligatures not joining

Posted: 2010-08-27T02:44:18-07:00
by tomleitch
Hi all,

Just an update to this - we eventually got it working by using Pango. We are rendering images as part of the normal content production chain from our content management system (Topcat 2).

Here is our normal mobile page: http://www.bbc.co.uk/hindi/mobile/
And here is the image version: http://www.bbc.co.uk/hindi/mobile/image/

Works a treat! We'll be launching a whole load of other sites using this method now.

Hope that helps some people,
tom

Re: IM 6.54 - Hindi text rendering - ligatures not joining

Posted: 2011-09-02T01:49:12-07:00
by sudhir.vis
The perfect way to render hindi font on image using php.
http://fatalweb.com/articles/how+to+ren ... php-29.htm