#!/bin/bash # Author: Gregory D. Weber # This script will install the fonts needed for Mozilla/Firefox to # render MathML. # Tell the script where you have Adobe Reader installed; # otherwise, it will try to guess the location: ACRO_HOME=/usr/local/acrobat-4.05 # ---------------------------------------------------------------------------- function giveUp () { echo "Error: cannot find Adobe Acrobat Reader." echo "If it is not installed, please install it now." echo "Otherwise, edit this script (mathml-fonts-install)" echo "and supply the correct value for the variable ACRO_HOME" echo "near the top of the file." } # Guess or find ACRO_HOME directory if [ -d $ACRO_HOME ]; then true elif [ -d /usr/local/Acrobat4 ]; then ACRO_HOME=/usr/local/Acrobat4 else # Try to find executable acroread and climb up the directory tree ACRO_BIN=`which acroread` if [ -z $ACRO_BIN ]; then giveUp exit 1 else if [ -h $ACRO_BIN ]; then # dereference symbolic link ACRO_BIN=`readlink --canonicalize $ACRO_BIN` fi # Climb directory tree two levels up ACRO_HOME1=`dirname $ACRO_BIN` ACRO_HOME=`dirname $ACRO_HOME1` fi fi ACRO_SYMBOL=$ACRO_HOME/Resource/Font/Symbol if [ -d $ACRO_HOME -a -f $ACRO_SYMBOL ]; then echo "Found Adobe Reader home directory = $ACRO_HOME" echo "Found Adobe Symbol font file = $ACRO_SYMBOL" else giveUp exit 2 fi # Install fonts needed for MathML in Mozilla Firefox if [ $USER == "root" ]; then DEST=/usr/share/fonts else DEST=$HOME/.fonts fi echo "Fonts will be installed in $DEST" echo "Removing any previous installation" rm -Rf $DEST/texcm-ttf $DEST/Mathematica-4.1 rm -f $DEST/Adobe/Symbol # Unpack archives if [ -d texcm-ttf ]; then echo "Directory texcm-ttf already exists." else echo "Unpacking texcm-ttf.zip" unzip texcm-ttf.zip > /dev/null fi if [ -d Mathematica-4.1 ]; then echo "Directory Mathematica-4.1 already exists." else echo "Unpacking MathFonts_TrueType.exe" unzip -d Mathematica-4.1 MathFonts_TrueType.exe > /dev/null fi # Install files echo "Installing texcm-ttf fonts" mv texcm-ttf $DEST echo "Installing Mathematica-4.1 fonts" mv Mathematica-4.1 $DEST echo "Installing Adobe Symbol font" install -D $ACRO_SYMBOL $DEST/Adobe/Symbol # Restart xfs if [ $USER == "root" ]; then echo "Restarting X Font Server" service xfs restart else echo "Installation complete. Please reboot." fi