moved from ../pdf2swf/font2swf.cc, rewritten.