Patrick J. S.
Patrick J. S.

Reputation: 2935

ImageMagick not rendering all Unicode characters

I want to render small single character images with ImageMagick.

I'm calling it like this:

echo -n "\u1407" | convert -background black -fill white \
  -font /usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf
  -pointsize 12 label:@- gif:1407.gif

When I just echo on my terminal, that has this font (DejaVu-Sans-Mono) set, I see this triangle: but in the GIF is just a question mark. No special markings, just a question mark. It works for some other characters, like these special parens: ⟨⟩ at 27e8 and 27e9, but the next pair isn't working again.

What do I need to do to enable all characters that the font supplies? Did I set the wrong font?

My distribution is LMDE.

Upvotes: 2

Views: 954

Answers (1)

emcconville
emcconville

Reputation: 24439

Working with bash & unicode, I always need to step back, and do an extra step.

echo -n ᐇ | hexdump

This gives me the correct hex-triplet

0000000 e1 90 87

So then my unicode escape sequence in bash would be..

echo -ne "\xE1\x90\x87"

(omitting the 0x0A which is the line-feed)

echo -ne "\xE1\x90\x87" | convert -background black -fill white \
  -font /usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf \
  -pointsize 12 label:@- gif:1407.gif

However this produces the following image character missing, as the character is not apart of the DejaVu Sans Mono set, but it is apart of the DejaVu Sans.

echo -ne "\xE1\x90\x87" | convert -background black -fill white \
  -font /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf \
  -pointsize 12 label:@- gif:1407.gif

works

Additional info about ᐇ

There could be a perfectly valid reason why this glyph is not included. A polite thing would be to reach out to the DejaVu team, and inquire if this is a bug, or included elsewhere. IRC & Mailing lists are a good start.

Upvotes: 2

Related Questions