#!/bin/sh
# config script to use gsfonts-wadalab to emulate
# other Japanese Postscript fonts.

MIN=gsfonts-wadalab-mincho
GOTH=gsfonts-wadalab-gothic

if [ -z "$1" ]
  then
    echo "This replaces the hint files for defoma"
    echo "and do \"defoma-font -q reregister-all <new hint file>\""
    echo ""
    echo "usage: gsfonts-wadalab-config [install|remove]"
    exit 1
fi

if [ "$1" = "install" ]
  then
    cp /usr/share/$MIN/${MIN}-fakeall.type3.hints /etc/defoma/hints/
    cp /usr/share/$GOTH/${GOTH}-fakeall.type3.hints /etc/defoma/hints/
    defoma-font -q reregister-all /etc/defoma/hints/${MIN}-fakeall.type3.hints
    defoma-font -q reregister-all /etc/defoma/hints/${GOTH}-fakeall.type3.hints
elif [ "$1" = "remove" ]
  then
    rm -f /etc/defoma/hints/${MIN}-fakeall.type3.hints
    rm -f /etc/defoma/hints/${GOTH}-fakeall.type3.hints
    defoma-font -q reregister-all /etc/defoma/hints/${MIN}.type3.hints
    defoma-font -q reregister-all /etc/defoma/hints/${GOTH}.type3.hints
else
   echo "\"$1\": unknown command. aborted!"
   exit 1
fi

