Khmer rendering ligatures 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
asterite

Khmer rendering ligatures problem

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

Re: Khmer rendering ligatures problem

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

Re: Khmer rendering ligatures problem

Post 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?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Khmer rendering ligatures problem

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
asterite

Re: Khmer rendering ligatures problem

Post 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.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Khmer rendering ligatures problem

Post by anthony »

I stand corrected.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply