Page 1 of 1

Khmer rendering ligatures problem

Posted: 2010-06-29T00:27:22-07:00
by asterite
I'm trying to render some khmer text that has ligatures. Here's the command I'm using:

convert -font KhmerOS -pointsize 72 label:យោ khmer.gif

but this is the result I'm getting: http://esperanto.org.ar/khmer/khmer.gif . So it seems like ImageMagick is not properly joining those characters.

While searching some posts here I found this: viewtopic.php?f=3&t=14467&p=51019&hilit=ligature . It seems like its the same kind of problem, but I don't think it's a FreeType problem since they say the ligature processing is done before using freetype: a higher level program determines the ligatures and then just asks the glyphs to FreeType.

I'm using Ubuntu 10.04. Version of ImageMagick is:
Version: ImageMagick 6.5.7-8 2009-11-26 Q16 http://www.imagemagick.org

To use the khmer fonts the package is ttf-khmeros

If something needs to be changed in ImageMagick for this to work I can try to help.

Thanks!
Ary

Re: Khmer rendering ligatures problem

Posted: 2010-06-29T05:18:20-07:00
by magick
a higher level program determines the ligatures and then just asks the glyphs to FreeType.
ImageMagick does not deal with ligatures and just calls FreeType directly. ImageMagick is open-source. If you want to tackle this problem, post your patches here under the ImageMagick license and we will get them into a future release of ImageMagick.

Re: Khmer rendering ligatures problem

Posted: 2010-06-30T00:53:54-07:00
by asterite
Thank you for the quick reply!

So I'm not understanding whether ImageMagick does not deal with ligatures but should, or FreeType should deal with ligatures instead.

If ImageMagick should lead with ligatures but it doesn't, I can take a look at the code and try to make it work. If that's not the case, what should I do? Modify FreeType? Is there any other layer that's the one that should be dealing with ligatures?

Re: Khmer rendering ligatures problem

Posted: 2010-07-01T20:30:51-07:00
by anthony
You should be able to modify the unicode of the text string being passed to IM to handle the ligatures.
That is what is meant by the higher level programming.

Re: Khmer rendering ligatures problem

Posted: 2010-07-04T22:14:05-07:00
by asterite
Hi anthony,

I don't think that's possible in Khmer. It's only two characters that show up as three glyphs and it's impossible to change the order of them such that the ligatures would display correctly because two of them need to surround the other glyph. For that unicode text gedit can display it perfectly while freetype and imagemagick can't, so the problem is in the rendering.

Re: Khmer rendering ligatures problem

Posted: 2010-07-04T23:00:04-07:00
by anthony
I stand corrected.