#! /bin/csh -f
# Make mf source files.
# edited for new file structure, FL

if ($#argv < 2) then
   echo "Usage: $0 typeface_name size [size ...]."
   exit(1)
endif

# Remember the typeface name (e.g., ``cmr'').
set typeface = $1
shift

# Make a src subdirectory to put the files in.
if (! -d src) then
   mkdir src
endif

# And go there.
cd src

foreach size ($argv)
   set name_size = $size:r # Lose any decimal digits.
   set mf_name = $typeface$name_size.mf
   
   # The Computer Modern point sizes are based on the 1.2 ratio.
   # Don't use this script if you prefer to have point
   # sizes that are exactly what you type.
   switch($size)
   case 11
      set size = 10.954451 # magstephalf
      breaksw
   case 14
      set size = 14.4	# magstep (1)
      breaksw
   case 17
      set size = 17.28	# magstep (2)
      breaksw
   case 20
      set size = 20.736 # magstep (3)
      breaksw
   case 25
      set size = 24.8832
      breaksw
   case 30
      set size = 29.8685984
      breaksw
   endsw

   # If it exists already, fine.
   if (! -r $mf_name) then
      echo "% $name_size-point $typeface." > $mf_name
      echo "design_size := $size;" >> $mf_name
      echo "input b-$typeface;" >> $mf_name
   endif
end

