writing unicode characters

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

writing unicode characters

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

Re: writing unicode characters

Post by magick »

You need Pango.
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

Re: writing unicode characters

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

Re: writing unicode characters

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

Re: writing unicode characters

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

Re: writing unicode characters

Post 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).
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

Re: writing unicode characters

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

Re: writing unicode characters

Post by anthony »

Sorry the other discussion was...
viewtopic.php?f=3&t=14467&p=62762&hilit=pango#p62762

And it also involved hindu text.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

Re: writing unicode characters

Post 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.
manit
Posts: 123
Joined: 2009-01-30T22:31:26-07:00

Re: writing unicode characters

Post by manit »

The only thing is
can we use this application in convert command ?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: writing unicode characters

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