#!/bin/sh 
# %Z%$RCSfile$ version $Revision: #4 $ created $Date: 2001/08/30 $
# %Z%%Q%
# This script adds the Open Look fonts

# You must have root permissions to install most of these files successfully.

# Make sure that the SHOME environment variable is set.

if [ "x\$SHOME" = "x" ]
then
    echo
    echo "*** ERROR: The SHOME environment variable is not set. ***"
    echo
    echo "You must run \$0 from the INSTALL script"
    exit 1
fi

# Source the environment variables used by the program
. $SHOME/splus/lib/install/DEFAULTS.sh

if [ ! -d $FONT_DEST ]
then
    echo
    echo "*** ERROR: no $FONT_DEST directory ***"
    echo
    exit 0
fi
if [ ! -d /usr/bin/X11 ]
then
    echo
    echo "*** ERROR: no /usr/bin/X11 directory ***"
	echo
    exit 0
fi

if [ ! -d "$FONT_DEST" ]
then
    echo "Cannot install OpenLook fonts, directory $FONT_DEST does not exist"
else
    echo "Adding the OpenLook fonts to \$FONT_DEST ..."
    for font in \`cat \$FONT_SOURCE/ALL_FONTS\`
    do
        bdftosnf \$FONT_SOURCE/\$font.bdf > \$FONT_DEST/\$font.snf || exit 1
    done

    echo "Adding these fonts to the list of fonts available ..."
    mkfontdir \$FONT_DEST || exit 1

    echo "Use the command: "
    echo "                 xset fp rehash"
    echo " to reset your windowing environment to use these new fonts."
    echo " Or just restart your windowing environment."
fi
exit 0
