Page 1 of 1

Rendering unicode characters

Posted: 2010-07-26T12:58:46-07:00
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.

Re: Rendering unicode characters

Posted: 2010-07-26T15:51:15-07:00
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.

Re: Rendering unicode characters

Posted: 2010-07-26T17:21:01-07:00
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.

Re: Rendering unicode characters

Posted: 2010-07-27T19:07:47-07:00
by ian313665
Thanks for the comments, they were indeed helpful ;)