Reputation: 2935
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
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 , 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
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