No unicode text

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
AcsPrime
Posts: 5
Joined: 2014-07-29T08:13:52-07:00
Authentication code: 6789

No unicode text

Post by AcsPrime »

Hey guys,

I have an image with some text. Some text needs to be in another language.
I have this in the code that creates the image

Code: Select all

-pointsize 17 -draw "text 10,-20 '사이츠 M'" \
I can see this perfectly in vim, but when the image is created I just see "???".
Do I have to turn something on?

I am using ImageMagick 6.5.4-7 2014-02-10 Q16 OpenMP on centos

Thanks
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: No unicode text

Post by fmw42 »

It may be a bug in your old version of IM, which is ancient at about 350 versions old. It could also be that you are not really pasting in the correct unicode characters. Try putting the text in to a file that supports unicode. Then use

draw "text 10,-20 '@filename'"

see if that works. But be sure your test editor is unicode compliant.

CORRECTION: I misread your draw command. The text 10,-20 was part of the text you wanted to print. So it must be in the text file. So the command is simply

-draw "@filename"

where filename is a text file that contains all the text you want to show.
AcsPrime
Posts: 5
Joined: 2014-07-29T08:13:52-07:00
Authentication code: 6789

Re: No unicode text

Post by AcsPrime »

Hey.

I updated my imagemagik version, it is now 6.8.9-0 Q16 x86_64

I tried doing what you said:

Code: Select all

 -draw "text 15,24 '@koreantext'"
I just the @koreantext printed in the image.
If I just do with the text I still get ???

Is there any other way?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: No unicode text

Post by snibgo »

When using the "@" format, I believe the file has to contain everything that would go between the outer quotes. See my page http://im.snibgo.com/snutf8.htm
snibgo's IM pages: im.snibgo.com
AcsPrime
Posts: 5
Joined: 2014-07-29T08:13:52-07:00
Authentication code: 6789

Re: No unicode text

Post by AcsPrime »

I am now using this command:

Code: Select all

-pointsize 16 -draw @koreantext 
And in the koreantext file I have this:

text 15,24 '사이츠'

I can see this in the command line (if I cat the file) and I can see this in vim but when this gets to the image I still see ???

What else can I do? Do I have to resort to using images for these symbols???
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: No unicode text

Post by snibgo »

What font are you using? Have you checked that the font contains those characters?
snibgo's IM pages: im.snibgo.com
AcsPrime
Posts: 5
Joined: 2014-07-29T08:13:52-07:00
Authentication code: 6789

Re: No unicode text

Post by AcsPrime »

Yes, this was the problem.
I had to use the Nanum Gothic font to get the symbol.

Thanks
Post Reply