#!/bin/csh -f
# need csh because of foreach used for running gftopk

echo "\
This script runs metafont and gftopk to produce the \
following fonts / family / shapes:\
\
  *********************************************************\
  AMS (AMS symbols, euler, cyrillic, dummy)\
  Note: the extracm fonts are made by mk_cm.\
  *********************************************************\
\
Give metafont mode as first argument (default = localfont)\
\
Volker Kuhlmann\
    9 July 94; 1 Jan 95; 8 Apr 95; 8 Apr 96\
v.kuhlmann@elec.canterbury.ac.nz\
"


# CHANGELOG
#
# 8 Apr 96 (VK)
#	Added \scrollmode. Fixed docs.
# 8 Apr 95 (VK)
#	Metafont mode can now be given as $1.
# 1 Jan 95 (VK)
#	Added cyrillic fonts.


if ( $#argv > 0 ) set MODE=$1
if ( ! $?MODE ) set MODE=localfont
echo ""
echo "**********************************"
echo 'metafont mode is set to: '$MODE
echo "**********************************"
echo ""

set MFARG='\mode='"$MODE"'; \scrollmode;'


# AMS SYMBOL A
cmmf "$MFARG"' \mag=magstep(0);'	input msam5
cmmf "$MFARG"' \mag=magstep(0);'	input msam6
cmmf "$MFARG"' \mag=magstep(0);'	input msam7
cmmf "$MFARG"' \mag=magstep(0);'	input msam8
cmmf "$MFARG"' \mag=magstep(0);'	input msam9
cmmf "$MFARG"' \mag=magstep(0);'	input msam10
cmmf "$MFARG"' \mag=magstep(0.5);'	input msam10	# 10.95pt
cmmf "$MFARG"' \mag=magstep(1);'	input msam10	# 12pt
cmmf "$MFARG"' \mag=magstep(2);'	input msam10	# 14.4pt
cmmf "$MFARG"' \mag=magstep(3);'	input msam10	# 17.28pt
cmmf "$MFARG"' \mag=magstep(4);'	input msam10	# 20.74pt
cmmf "$MFARG"' \mag=magstep(5);'	input msam10	# 24.88pt

# AMS SYMBOL B
cmmf "$MFARG"' \mag=magstep(0);'	input msbm5
cmmf "$MFARG"' \mag=magstep(0);'	input msbm6
cmmf "$MFARG"' \mag=magstep(0);'	input msbm7
cmmf "$MFARG"' \mag=magstep(0);'	input msbm8
cmmf "$MFARG"' \mag=magstep(0);'	input msbm9
cmmf "$MFARG"' \mag=magstep(0);'	input msbm10
cmmf "$MFARG"' \mag=magstep(0.5);'	input msbm10	# 10.95pt
cmmf "$MFARG"' \mag=magstep(1);'	input msbm10	# 12pt
cmmf "$MFARG"' \mag=magstep(2);'	input msbm10	# 14.4pt
cmmf "$MFARG"' \mag=magstep(3);'	input msbm10	# 17.28pt
cmmf "$MFARG"' \mag=magstep(4);'	input msbm10	# 20.74pt
cmmf "$MFARG"' \mag=magstep(5);'	input msbm10	# 24.88pt

# AMS EULER FRAKTUR
mf "$MFARG"' \mag=magstep(0);'		input eufm5
mf "$MFARG"' \mag=magstep(0);'		input eufm6
mf "$MFARG"' \mag=magstep(0);'		input eufm7
mf "$MFARG"' \mag=magstep(0);'		input eufm8
mf "$MFARG"' \mag=magstep(0);'		input eufm9
mf "$MFARG"' \mag=magstep(0);'		input eufm10
mf "$MFARG"' \mag=magstep(0.5);'	input eufm10	# 10.95pt
mf "$MFARG"' \mag=magstep(1);'		input eufm10	# 12pt
mf "$MFARG"' \mag=magstep(2);'		input eufm10	# 14.4pt
mf "$MFARG"' \mag=magstep(3);'		input eufm10	# 17.28pt
mf "$MFARG"' \mag=magstep(4);'		input eufm10	# 20.74pt
mf "$MFARG"' \mag=magstep(5);'		input eufm10	# 24.88pt

# AMS EULER FRAKTUR BOLD
mf "$MFARG"' \mag=magstep(0);'		input eufb5
mf "$MFARG"' \mag=magstep(0);'		input eufb6
mf "$MFARG"' \mag=magstep(0);'		input eufb7
mf "$MFARG"' \mag=magstep(0);'		input eufb8
mf "$MFARG"' \mag=magstep(0);'		input eufb9
mf "$MFARG"' \mag=magstep(0);'		input eufb10
mf "$MFARG"' \mag=magstep(0.5);'	input eufb10	# 10.95pt
mf "$MFARG"' \mag=magstep(1);'		input eufb10	# 12pt
mf "$MFARG"' \mag=magstep(2);'		input eufb10	# 14.4pt
mf "$MFARG"' \mag=magstep(3);'		input eufb10	# 17.28pt
mf "$MFARG"' \mag=magstep(4);'		input eufb10	# 20.74pt
mf "$MFARG"' \mag=magstep(5);'		input eufb10	# 24.88pt

# AMS EULER SCRIPT
mf "$MFARG"' \mag=magstep(0);'		input eusm5
mf "$MFARG"' \mag=magstep(0);'		input eusm6
mf "$MFARG"' \mag=magstep(0);'		input eusm7
mf "$MFARG"' \mag=magstep(0);'		input eusm8
mf "$MFARG"' \mag=magstep(0);'		input eusm9
mf "$MFARG"' \mag=magstep(0);'		input eusm10
mf "$MFARG"' \mag=magstep(0.5);'	input eusm10	# 10.95pt
mf "$MFARG"' \mag=magstep(1);'		input eusm10	# 12pt
mf "$MFARG"' \mag=magstep(2);'		input eusm10	# 14.4pt
mf "$MFARG"' \mag=magstep(3);'		input eusm10	# 17.28pt
mf "$MFARG"' \mag=magstep(4);'		input eusm10	# 20.74pt
mf "$MFARG"' \mag=magstep(5);'		input eusm10	# 24.88pt

# AMS EULER SCRIPT BOLD
mf "$MFARG"' \mag=magstep(0);'		input eusb5
mf "$MFARG"' \mag=magstep(0);'		input eusb6
mf "$MFARG"' \mag=magstep(0);'		input eusb7
mf "$MFARG"' \mag=magstep(0);'		input eusb8
mf "$MFARG"' \mag=magstep(0);'		input eusb9
mf "$MFARG"' \mag=magstep(0);'		input eusb10
mf "$MFARG"' \mag=magstep(0.5);'	input eusb10	# 10.95pt
mf "$MFARG"' \mag=magstep(1);'		input eusb10	# 12pt
mf "$MFARG"' \mag=magstep(2);'		input eusb10	# 14.4pt
mf "$MFARG"' \mag=magstep(3);'		input eusb10	# 17.28pt
mf "$MFARG"' \mag=magstep(4);'		input eusb10	# 20.74pt
mf "$MFARG"' \mag=magstep(5);'		input eusb10	# 24.88pt

# AMS EULER MATH EXTENSION
mf "$MFARG"' \mag=magstep(0);'		input euex7
mf "$MFARG"' \mag=magstep(0);'		input euex8
mf "$MFARG"' \mag=magstep(0);'		input euex9
mf "$MFARG"' \mag=magstep(0);'		input euex10
mf "$MFARG"' \mag=magstep(0.5);'	input euex10	# 10.95pt
mf "$MFARG"' \mag=magstep(1);'		input euex10	# 12pt
mf "$MFARG"' \mag=magstep(2);'		input euex10	# 14.4pt
mf "$MFARG"' \mag=magstep(3);'		input euex10	# 17.28pt
mf "$MFARG"' \mag=magstep(4);'		input euex10	# 20.74pt
mf "$MFARG"' \mag=magstep(5);'		input euex10	# 24.88pt

# AMS EULER MATH ROMAN
# AMS EULER ROMAN
mf "$MFARG"' \mag=magstep(0);'		input eurm5
mf "$MFARG"' \mag=magstep(0);'		input eurm6
mf "$MFARG"' \mag=magstep(0);'		input eurm7
mf "$MFARG"' \mag=magstep(0);'		input eurm8
mf "$MFARG"' \mag=magstep(0);'		input eurm9
mf "$MFARG"' \mag=magstep(0);'		input eurm10
mf "$MFARG"' \mag=magstep(0.5);'	input eurm10	# 10.95pt
mf "$MFARG"' \mag=magstep(1);'		input eurm10	# 12pt
mf "$MFARG"' \mag=magstep(2);'		input eurm10	# 14.4pt
mf "$MFARG"' \mag=magstep(3);'		input eurm10	# 17.28pt
mf "$MFARG"' \mag=magstep(4);'		input eurm10	# 20.74pt
mf "$MFARG"' \mag=magstep(5);'		input eurm10	# 24.88pt

# AMS EULER MATH ROMAN BOLD
# AMS EULER ROMAN BOLD
mf "$MFARG"' \mag=magstep(0);'		input eurb5
mf "$MFARG"' \mag=magstep(0);'		input eurb6
mf "$MFARG"' \mag=magstep(0);'		input eurb7
mf "$MFARG"' \mag=magstep(0);'		input eurb8
mf "$MFARG"' \mag=magstep(0);'		input eurb9
mf "$MFARG"' \mag=magstep(0);'		input eurb10
mf "$MFARG"' \mag=magstep(0.5);'	input eurb10	# 10.95pt
mf "$MFARG"' \mag=magstep(1);'		input eurb10	# 12pt
mf "$MFARG"' \mag=magstep(2);'		input eurb10	# 14.4pt
mf "$MFARG"' \mag=magstep(3);'		input eurb10	# 17.28pt
mf "$MFARG"' \mag=magstep(4);'		input eurb10	# 20.74pt
mf "$MFARG"' \mag=magstep(5);'		input eurb10	# 24.88pt

# AMS CYRILLIC
mf "$MFARG"' \mag=magstep(0);'		input wncyr5
mf "$MFARG"' \mag=magstep(0);'		input wncyr6
mf "$MFARG"' \mag=magstep(0);'		input wncyr7
mf "$MFARG"' \mag=magstep(0);'		input wncyr8
mf "$MFARG"' \mag=magstep(0);'		input wncyr9
mf "$MFARG"' \mag=magstep(0);'		input wncyr10
mf "$MFARG"' \mag=magstep(0.5);'	input wncyr10	# 10.95pt
mf "$MFARG"' \mag=magstep(1);'		input wncyr10	# 12pt
mf "$MFARG"' \mag=magstep(2);'		input wncyr10	# 14.4pt
mf "$MFARG"' \mag=magstep(3);'		input wncyr10	# 17.28pt
mf "$MFARG"' \mag=magstep(4);'		input wncyr10	# 20.74pt
mf "$MFARG"' \mag=magstep(5);'		input wncyr10	# 24.88pt

# AMS CYRILLIC BOLD
mf "$MFARG"' \mag=magstep(0);'		input wncyb5
mf "$MFARG"' \mag=magstep(0);'		input wncyb6
mf "$MFARG"' \mag=magstep(0);'		input wncyb7
mf "$MFARG"' \mag=magstep(0);'		input wncyb8
mf "$MFARG"' \mag=magstep(0);'		input wncyb9
mf "$MFARG"' \mag=magstep(0);'		input wncyb10
mf "$MFARG"' \mag=magstep(0.5);'	input wncyb10	# 10.95pt
mf "$MFARG"' \mag=magstep(1);'		input wncyb10	# 12pt
mf "$MFARG"' \mag=magstep(2);'		input wncyb10	# 14.4pt
mf "$MFARG"' \mag=magstep(3);'		input wncyb10	# 17.28pt
mf "$MFARG"' \mag=magstep(4);'		input wncyb10	# 20.74pt
mf "$MFARG"' \mag=magstep(5);'		input wncyb10	# 24.88pt

# AMS CYRILLIC ITALICS
mf "$MFARG"' \mag=magstep(0);'		input wncyi5
mf "$MFARG"' \mag=magstep(0);'		input wncyi6
mf "$MFARG"' \mag=magstep(0);'		input wncyi7
mf "$MFARG"' \mag=magstep(0);'		input wncyi8
mf "$MFARG"' \mag=magstep(0);'		input wncyi9
mf "$MFARG"' \mag=magstep(0);'		input wncyi10
mf "$MFARG"' \mag=magstep(0.5);'	input wncyi10	# 10.95pt
mf "$MFARG"' \mag=magstep(1);'		input wncyi10	# 12pt
mf "$MFARG"' \mag=magstep(2);'		input wncyi10	# 14.4pt
mf "$MFARG"' \mag=magstep(3);'		input wncyi10	# 17.28pt
mf "$MFARG"' \mag=magstep(4);'		input wncyi10	# 20.74pt
mf "$MFARG"' \mag=magstep(5);'		input wncyi10	# 24.88pt

# AMS CYRILLIC SANS SERIF
mf "$MFARG"' \mag=magstep(0);'		input wncyss8
mf "$MFARG"' \mag=magstep(0);'		input wncyss9
mf "$MFARG"' \mag=magstep(0);'		input wncyss10
mf "$MFARG"' \mag=magstep(0.5);'	input wncyss10	# 10.95pt
mf "$MFARG"' \mag=magstep(1);'		input wncyss10	# 12pt
mf "$MFARG"' \mag=magstep(2);'		input wncyss10	# 14.4pt
mf "$MFARG"' \mag=magstep(3);'		input wncyss10	# 17.28pt
mf "$MFARG"' \mag=magstep(4);'		input wncyss10	# 20.74pt
mf "$MFARG"' \mag=magstep(5);'		input wncyss10	# 24.88pt

# AMS CYRILLIC SMALL CAPS
mf "$MFARG"' \mag=magstep(0);'		input wncysc10
mf "$MFARG"' \mag=magstep(0.5);'	input wncysc10	# 10.95pt
mf "$MFARG"' \mag=magstep(1);'		input wncysc10	# 12pt
mf "$MFARG"' \mag=magstep(2);'		input wncysc10	# 14.4pt
mf "$MFARG"' \mag=magstep(3);'		input wncysc10	# 17.28pt
mf "$MFARG"' \mag=magstep(4);'		input wncysc10	# 20.74pt
mf "$MFARG"' \mag=magstep(5);'		input wncysc10	# 24.88pt

# AMS DUMMY
mf "$MFARG"' \mag=magstep(0);'		input dummy


echo ""
echo "Metafont finished."
echo ""



echo "Now running GFtoPK."

# note this requires csh or tcsh
foreach file (*gf)
  gftopk $file
end

echo "GFtoPK finished."
echo ""

echo ""
echo "To complete the font installation, do the following:"
echo "  copy all .tfm-files into the tfm directory"
echo "  copy all .pk-files into the pk-directory"
echo "  delete all .gf files."
echo ""
echo "Have a nice day."
echo ""