Rendering 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
ian313665

Rendering unicode characters

Post by ian313665 »

Hi, I'm using ImageMagick so create a character map for rendering strings in OpenGL.

ImageMagick is producing the expected result for most of the characters I want but I do get a '?' rendered when I use an uncommon unicode character.

To generate the font table I loop through this command replacing the letter A with the input variable.

Code: Select all

convert -background none -fill white -pointsize 100 label:A output.png
The character I'm having trouble with is '⋅' (Dot operator) UNICODE 22 C5 : UTF8 E2 88 85.

Now, this is no big issue for me. I can easily handle a few manual steps to get the character I want. I'm just asking if there is a nicer way to handle this.

Any help/suggestions would be highly appreciated, thanks.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Rendering unicode characters

Post by fmw42 »

see http://www.imagemagick.org/Usage/text/#unicode

You may have to put the characters in a utf-8 compatible file (editor needs to be utf-8 compatible and file saved as utf-8), then read the file in with label:@filename

some copy and paste editors to terminals may not be utf-8 compatible

You did not specify a font, so the font may also be at issue as not having the (math ?) dot symbol.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Rendering unicode characters

Post by anthony »

That same link also points to methods of using bash and perl for converting unicode 16bit hexadecimal character codes into utf-8 strings.

Their many other programs and almost all languages that can also do this conversion.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
ian313665

Re: Rendering unicode characters

Post by ian313665 »

Thanks for the comments, they were indeed helpful ;)
Post Reply