Page 1 of 1

writing unicode characters

Posted: 2010-09-13T07:12:32-07:00
by manit
Hi I have akshar unicode font installed on my system
I was trying to write text in hindi to an image

I gave command
convert -pointsize 36 -font AksharUnicode label:"क्या हो रहा है |" what.jpg
In my file I get
क् या हो रहा है
Actually क् is joined to या in image.
Why dont the letters join .
I know that there is no half letter of hindi in unicode.
In hindi there is a rule that letter in हलन्त becomes half & adds to following letter .

Re: writing unicode characters

Posted: 2010-09-13T09:48:23-07:00
by magick
You need Pango.

Re: writing unicode characters

Posted: 2010-09-13T22:20:56-07:00
by manit
I am using ubuntu 10.04.
Version: ImageMagick 6.5.7-8 2009-11-26 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC
Features: OpenMP

I have following installed

libpangomm-1.4-1 2.26.1-1
libpango-perl 1.221-2
libpango1.0-0 1.28.0-0ubuntu2
libpango1.0-common 1.28.0-0ubuntu2
libpango1.0-dev 1.28.0-0ubuntu2

I saw this page viewtopic.php?f=3&t=14467
what else do I need ?
Can you illustrate ?

Re: writing unicode characters

Posted: 2010-09-14T18:05:03-07:00
by anthony
Pango is a wrapper around the font rendering system taht handles this type special requirements of international fonts.
You can use pango directly to render your hindu unicode strings.

IM does not call pango itself as that would add another dependency to the library, just for Linux machines only.

there was another disscussion whcih showed an example of how to use pango.

Re: writing unicode characters

Posted: 2010-09-15T01:09:18-07:00
by manit
I could not find anything which explains using pango.

By the way - I wrote 'क्या हो रहा है ?' in text file &
then ran
$pango-view file.txt
The display was fine.

Re: writing unicode characters

Posted: 2010-09-15T01:13:20-07:00
by anthony
Maybe we should ask 'Magick' to add a 'pango' delegate for text generation. It may even be just a call to 'pango-view'.

It may not have the bells and whistles of label: but it will be better for international unicode text like Hindu, that had ligatures (joining of two or more characters together).

Re: writing unicode characters

Posted: 2010-09-15T07:11:22-07:00
by manit
there was another disscussion whcih showed an example of how to use pango.
Thank you , Sir . For your prompt reply but still I could not find the method.

Re: writing unicode characters

Posted: 2010-09-15T18:24:46-07:00
by anthony
Sorry the other discussion was...
viewtopic.php?f=3&t=14467&p=62762&hilit=pango#p62762

And it also involved hindu text.

Re: writing unicode characters

Posted: 2010-09-15T23:47:32-07:00
by manit
i asked tomleitch & he told to use command "pango-view".
It works as follows
pango-view input-file.txt -q -o output.jpg
pango-view -t "input_string" -q -o output.jpg

you can do --font="Times New Roman 24px"
To choose font size.

Thanks to anthony & tomleitch for their quick replies.

Re: writing unicode characters

Posted: 2010-09-20T00:45:18-07:00
by manit
The only thing is
can we use this application in convert command ?

Re: writing unicode characters

Posted: 2010-09-20T19:22:01-07:00
by anthony
It may be possible to create a delegate. But it may not work with a command line string.
As placing a user defined sting on the command line of a delegate can open up all sorts of
security holes and implications. If the string could be piped into the command, yes a delegate might be posible.

If a special 'coder' module for say "pango:string" was added to IM, which then used the pango library or call the command (with appropriate security checks), then YES it can be added.

Coder modules are relativally straight forward to create. Even some friends who are non-C-programmers managed to create a basic 'coder' for a special project. All it takes is someone who has the drive to do it :-)

Open Source is a wonderful thing!