#!/bin/sh

makecmap()
{
	[ "$1" != "UTF8" ] && ln -sf /usr/local/share/texmf/ttf2pk/$3.sfd
	latex '\def\cmapEnc{'$1'}' '\input{makecmap.tex}'
	rm -f $3.sfd makecmap.aux makecmap.log makecmap.dvi
	mkdir c$2
	mv c$2*.cmap c$2/
}

makecmap Bg5   00    UBig5
makecmap Bg5+  09    UBg5plus
makecmap GB    10    UGB
makecmap GBK   19    UGBK
makecmap JIS   40    UJIS
makecmap UTF8  70    Unicode
