#!/bin/bash

######################################################
# This script builds the directory 
#
#	source/TeXfonts/fonts
#
# which contains symbolic links to pfb files for fonts in TeX Live.
#
# First insure that the current TeX Live is the active distribution.
# Then run this script.
#
######################################################

# We're going to run this in the MacTeX/Ghostscript working directory...
WORK=`pwd`

# echo "Removing old file tree at ${WORK}/source/TeXfonts/fonts"
rm -rf ${WORK}/source/TeXfonts/fonts

mkdir -p ${WORK}/source/TeXfonts/fonts


# Add symlinks to the Charter and Utopia fonts

ln -s /Library/TeX/Root/texmf-dist/fonts/type1/bitstrea/charter/bchb8a.pfb ${WORK}/source/TeXfonts/fonts/
ln -s /Library/TeX/Root/texmf-dist/fonts/type1/bitstrea/charter/bchbi8a.pfb ${WORK}/source/TeXfonts/fonts/
ln -s /Library/TeX/Root/texmf-dist/fonts/type1/bitstrea/charter/bchr8a.pfb ${WORK}/source/TeXfonts/fonts/
ln -s /Library/TeX/Root/texmf-dist/fonts/type1/bitstrea/charter/bchri8a.pfb ${WORK}/source/TeXfonts/fonts/

ln -s /Library/TeX/Root/texmf-dist/fonts/type1/adobe/utopia/putb8a.pfb ${WORK}/source/TeXfonts/fonts/
ln -s /Library/TeX/Root/texmf-dist/fonts/type1/adobe/utopia/putbi8a.pfb ${WORK}/source/TeXfonts/fonts/
ln -s /Library/TeX/Root/texmf-dist/fonts/type1/adobe/utopia/putr8a.pfb ${WORK}/source/TeXfonts/fonts/
ln -s /Library/TeX/Root/texmf-dist/fonts/type1/adobe/utopia/putri8a.pfb ${WORK}/source/TeXfonts/fonts/

# Add symlinks to remaining type1 TeX fonts


ln -s /Library/TeX/Root/texmf-dist/fonts/type1/public/amsfonts/cm/*.pfb ${WORK}/source/TeXfonts/fonts/
ln -s /Library/TeX/Root/texmf-dist/fonts/type1/public/amsfonts/latxfont/*.pfb ${WORK}/source/TeXfonts/fonts/
ln -s /Library/TeX/Root/texmf-dist/fonts/type1/public/amsfonts/cmextra/*.pfb ${WORK}/source/TeXfonts/fonts/
ln -s /Library/TeX/Root/texmf-dist/fonts/type1/public/amsfonts/cyrillic/*.pfb ${WORK}/source/TeXfonts/fonts/
ln -s /Library/TeX/Root/texmf-dist/fonts/type1/public/amsfonts/euler/*.pfb ${WORK}/source/TeXfonts/fonts/
ln -s /Library/TeX/Root/texmf-dist/fonts/type1/public/amsfonts/symbols/*.pfb ${WORK}/source/TeXfonts/fonts/

ln -s /Library/TeX/Root/texmf-dist/fonts/type1/hoekwater/context/*.pfb ${WORK}/source/TeXfonts/fonts/
ln -s /Library/TeX/Root/texmf-dist/fonts/type1/hoekwater/mflogo-font/*.pfb ${WORK}/source/TeXfonts/fonts/
ln -s /Library/TeX/Root/texmf-dist/fonts/type1/hoekwater/manfnt-font/*.pfb ${WORK}/source/TeXfonts/fonts/

ln -s /Library/TeX/Root/texmf-dist/fonts/type1/public/rsfs/*.pfb ${WORK}/source/TeXfonts/fonts/
ln -s /Library/TeX/Root/texmf-dist/fonts/type1/public/stmaryrd/*.pfb ${WORK}/source/TeXfonts/fonts/
ln -s /Library/TeX/Root/texmf-dist/fonts/type1/public/tipa/*.pfb ${WORK}/source/TeXfonts/fonts/
ln -s /Library/TeX/Root/texmf-dist/fonts/type1/public/wasy2-ps/*.pfb ${WORK}/source/TeXfonts/fonts/

ln -s /Library/TeX/Root/texmf-dist/fonts/type1/public/belleek/*.pfb ${WORK}/source/TeXfonts/fonts/
ln -s /Library/TeX/Root/texmf-dist/fonts/type1/public/cmcyr/*.pfb ${WORK}/source/TeXfonts/fonts/
ln -s /Library/TeX/Root/texmf-dist/fonts/type1/public/cs/*.pfb ${WORK}/source/TeXfonts/fonts/
ln -s /Library/TeX/Root/texmf-dist/fonts/type1/public/marvosym/*.pfb ${WORK}/source/TeXfonts/fonts/
ln -s /Library/TeX/Root/texmf-dist/fonts/type1/public/omega/*.pfb ${WORK}/source/TeXfonts/fonts/
ln -s /Library/TeX/Root/texmf-dist/fonts/type1/public/pl/*.pfb ${WORK}/source/TeXfonts/fonts/
ln -s /Library/TeX/Root/texmf-dist/fonts/type1/public/pxfonts/*.pfb ${WORK}/source/TeXfonts/fonts/
ln -s /Library/TeX/Root/texmf-dist/fonts/type1/public/txfonts/*.pfb ${WORK}/source/TeXfonts/fonts/
ln -s /Library/TeX/Root/texmf-dist/fonts/type1/public/xypic/*.pfb ${WORK}/source/TeXfonts/fonts/


