I've been trying to learn a little bit of Japanese, just for the hell of it, and so I've been wanting to look at good quality renderings of particular symbols to get the feel of what they look like.
I've hacked up a little program in C (render-unicode-character.c) to render glyphs from TrueType fonts, using the FreeType library (version 2). It works quite well. It doesn't do anything clever, just outputs a PGM image (to standard output) showing a single glyph.
The following options can be passed in:
-f— filename of the font file to use (required)-s— point size to render at (default 72)-r— resolution to render at, in DPI (default 600)-b— number of pixels of blank border to put round the edge (default 10)
The default values give nice big output. The only non-option
argument to supply is the character code (in Unicode) of the character
to render. It can be given as decimal or hexadecimal (if you prefix
it with 0x).
As an example I dug a random interesting-looking kanji out of Edict (a free Japanese dictionary in a big text file). This is 磯 (beach), pronounced いそ (iso). It's Unicode character U+78EF from the free Kochi Mincho font.
