cks@white.toronto.edu (Chris Siebenmann) (02/28/90)
We have a DEC LN03R printer here, and need to regenerate all of the standard TeX fonts in all the various standard sizes for it (since it's a write-white engine). Does anyone have a canned script to do this, or pointers to an easy way to do it? I already have a set of mode settings that seems to work well, so all I need is a list of magsteps and so on to feed MetaFont. -- "I shall clasp my hands together and bow to the corners of the world." Number Ten Ox, "Bridge of Birds" cks@white.toronto.edu ...!{utgpu,utzoo,watmath}!utcsri!white!cks
ken@cs.rochester.edu (Ken Yap) (02/28/90)
Here are the shell scripts I use on Unix to generate a script. Or you can extract the fontname and magnification information encoded within. #!/bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #!/bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # genfonts # magpk # This archive created: Tue Feb 27 20:19:57 1990 # By: Ken Yap () export PATH; PATH=/bin:$PATH echo shar: extracting "'genfonts'" '(2250 characters)' if test -f 'genfonts' then echo shar: over-writing existing file "'genfonts'" fi cat << \SHAR_EOF > 'genfonts' #!/bin/sh # cmmf is usually just an alias for mf # cmbase.mf must be accessible when making TeX fonts # basic fonts in magsteps 0 through 5 and 0.5 for font in cmb10 cmbx10 cmbx5 cmbx7 cmcsc10 cmex10 cmmi10 cmmi5 cmmi7 \ cmr10 cmr5 cmr7 cmsl10 cmss10 cmssbx10 cmsy10 cmsy5 cmsy7 cmti10 cmtt10 do for magstep in 0 0.5 1 2 3 4 5 do res=`magpk $magstep` echo "cmmf '\mode=localfont; \mag=magstep$magstep; \batchmode;' input $font" echo gftopk $font.${res}gf echo rm $font.${res}gf done done # other fonts only in magsteps 0, 0.5 and 1 for font in cmbsy10 cmbx12 cmbx6 cmbx7 cmbx8 cmbx9 cmbxsl10 cmbxti10 \ cmdunh10 cmff10 cmfi10 cmfib8 cmitt10 cmmi12 cmmi6 cmmi8 cmmi9 \ cmmib10 cmr12 cmr17 cmr6 cmr8 cmr9 cmsl12 cmsl8 cmsl9 cmsltt10 \ cmss12 cmss17 cmss8 cmss9 cmssdc10 cmssi10 cmssi12 cmssi17 \ cmssi8 cmssi9 cmssq8 cmssqi8 cmsy6 cmsy8 cmsy9 cmtcsc10 cmtex10 \ cmtex8 cmtex9 cmti12 cmti7 cmti8 cmti9 cmtt12 cmtt8 cmtt9 cmu10 \ cmvtt10 do for magstep in 0 0.5 1 do res=`magpk $magstep` echo "cmmf '\mode=localfont; \mag=magstep$magstep; \batchmode;' input $font" echo gftopk $font.${res}gf echo rm $font.${res}gf done done # specials for magstep in 0 0.5 1 do res=`magpk $magstep` echo "cmmf '\mode=localfont; \mag=magstep$magstep; \batchmode;' input logo10" echo gftopk logo10.${res}gf echo rm logo10.${res}gf done echo "cmmf '\mode=localfont; \mag=magstep0; \batchmode;' input cminch" echo gftopk cminch.300gf echo rm cminch.300gf # LaTeX fonts for font in lasy10 lasy5 lasy7 lasyb10 do for magstep in 0 0.5 1 2 3 4 5 do res=`magpk $magstep` echo "cmmf '\mode=localfont; \mag=magstep$magstep; \batchmode;' input $font" echo gftopk $font.${res}gf echo rm $font.${res}gf done done # These fonts should not use cmbase for font in circle10 circlew10 line10 linew10 do for magstep in 0 0.5 1 2 3 4 5 do res=`magpk $magstep` echo "mf '\mode=localfont; \mag=magstep$magstep; \batchmode;' input $font" echo gftopk $font.${res}gf echo rm $font.${res}gf done done for font in lasy6 lasy8 lasy9 do for magstep in 0 0.5 1 do res=`magpk $magstep` echo "cmmf '\mode=localfont; \mag=magstep$magstep; \batchmode;' input $font" echo gftopk $font.${res}gf echo rm $font.${res}gf done done SHAR_EOF if test 2250 -ne "`wc -c 'genfonts'`" then echo shar: error transmitting "'genfonts'" '(should have been 2250 characters)' fi chmod +x 'genfonts' echo shar: extracting "'magpk'" '(223 characters)' if test -f 'magpk' then echo shar: over-writing existing file "'magpk'" fi cat << \SHAR_EOF > 'magpk' #!/bin/sh case $1 in 0.5) echo 329 ;; 0) echo 300 ;; 1) echo 360 ;; 2) echo 432 ;; 3) echo 518 ;; 4) echo 622 ;; 5) echo 746 ;; 6) echo 896 ;; 7) echo 1075 ;; 8) echo 1290 ;; 9) echo 1548 ;; *) echo 000 ;; esac SHAR_EOF if test 223 -ne "`wc -c 'magpk'`" then echo shar: error transmitting "'magpk'" '(should have been 223 characters)' fi chmod +x 'magpk' # End of shell archive exit 0
rusty@garnet.berkeley.edu (rusty wright) (03/01/90)
Well, since we're posting, here's Jeff McCarrell's: Here are 4 files; gen_cm, gen_latex, gen_slitex, and mfgen. mfgen is the driver, the other 3 tell it what to generate and at what magsteps. The primary headache with mfgen is if it bombs in the middle of one of the gen_ files it isn't easy to restart because it always wants to start from scratch. That shouldn't be to hard to fix though. ===> mfgen <=== #! /bin/sh # # Create a set of related fonts given a parameter file as input using # Metafont. # # Jeff McCarrell, 12/86. Based on ideas from Rusty Wright. # Univ. California at Berkeley. # # MFINPUTS=${MFINPUTS-`pwd`/src} export MFINPUTS case $# in 0) echo "`basename $0`: <-m mode> <-o {pxl,pk,gf}> <-d dir> parameter_file" ; exit 1 ;; esac while test $# -gt 0; do case $1 in -m) shift case $1 in -*) echo "garbled mode (-m): $1" ; exit 2 ;; *) mode=$1 ;; esac ;; -o) shift case $1 in pxl|pk|gf) otype=$1 ;; -*) echo "garbled output type (-o) $1" ; exit 2 ;; *) echo "unknown output type $1" ; exit 2 ;; esac ;; -d) shift case $1 in -*) echo "garbled root dir (-d) $1" ; exit 2 ;; *) rootdir=$1 ;; esac ;; *) pfile=$1 # must be a filename. ;; esac shift done pfile=${pfile?"Usage: must specify a parameter file"} otype=${otype-gf} mode=${mode-localfont} rootdir=${rootdir-$mode} # # Now that all the variables are in known states, set up the directory # structure. # if test ! -d ${rootdir} then mkdir $rootdir 1>&2 || { echo "couldn't make root directory $rootdir"; exit 4; } fi for f in gf log tfm ; do if test ! -d ${rootdir}/${f} then mkdir ${rootdir}/$f 1>&2 || { echo "couldn't make $f dir"; exit 4; } fi done case $otype in pk|pxl) if test ! -d ${rootdir}/${otype} then mkdir ${rootdir}/$otype 1>&2 || { echo "couldn't make $otype dir"; exit 4; } fi ;; esac cp $pfile ${rootdir}/gf/$pfile cd ${rootdir}/gf trap 'rm -f $pfile; exit 1' 1 2 15 # # we do the actual Metafont runs inside the gf directory. # # We redirect the entire sequence of commands that parse the command file # and call Metafont so we can use the shell builtin read to give the # arguments in an easy-to-handle manner. # { while read name sizes ; do case $name in *:*) set `echo $name | sed "s/\(.*\):\(.*\)/\1 \2/"` test -z "$1" && test -z "$2" && { echo "garbled name/mode: $name"; exit 6; } name=$1; xmode=$2 ;; *) xmode=$mode ;; esac for size in $sizes ; do case $size in @*) set `echo $size | sed "s/@\(.*\)/\1/"` size=$1 ;; *) size="magstep ${size}" ;; esac mf "\\mode:=${xmode}; mag:=${size}; scrollmode; input $name " mv *tfm ../tfm ; mv *log ../log done case $otype in pk|pxl) for f in ${name}.*gf ; do gfto$otype $f rm $f done mv *$otype ../$otype ;; esac done } < $pfile rm -f $pfile exit 0 ===> gen_cm <=== cmb10 0 0.5 1 2 cmbsy10 0 0.5 1 2 cmbx10 0 0.5 1 2 3 4 5 cmbx12 0 0.5 1 2 cmbx5 0 0.5 1 2 cmbx6 0 0.5 1 2 cmbx7 0 0.5 1 2 cmbx8 0 0.5 1 2 cmbx9 0 0.5 1 2 cmbxsl10 0 0.5 1 2 cmbxti10 0 0.5 1 2 cmcsc10 0 0.5 1 2 3 4 5 cmdunh10 0 0.5 1 2 cmex9 0 0.5 1 2 cmex10 0 0.5 1 2 cmff10 0 0.5 1 2 cmfi10 0 0.5 1 2 cmfib8 0 0.5 1 2 cminch 0 0.5 1 2 cmitt10 0 0.5 1 2 cmmi10 0 0.5 1 2 3 4 5 cmmi12 0 0.5 1 2 cmmi5 0 0.5 1 2 cmmi6 0 0.5 1 2 cmmi7 0 0.5 1 2 cmmi8 0 0.5 1 2 cmmi9 0 0.5 1 2 cmmib10 0 0.5 1 2 cmr10 0 0.5 1 2 3 4 5 cmr12 0 0.5 1 2 cmr17 0 0.5 1 2 cmr5 0 0.5 1 2 cmr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8 0 0.5 1 2 icmsy8 0 0.5 1 2 icmtt8 0 0.5 1 2 ===> gen_slitex <=== cmex10 3 cmmi8 3 4 5 @2.986 @3.583 @4.3 cmsy8 3 4 5 @2.986 @3.583 @4.3 cmtt8 3 4 5 @2.986 @3.583 @4.3 icmex10 3 icmmi8 3 4 5 @2.986 @3.583 @4.3 icmsy8 3 4 5 @2.986 @3.583 @4.3 icmtt8 3 4 5 @2.986 @3.583 @4.3 ilasy8 3 4 5 @2.986 @3.583 @4.3 ilcmss8 3 4 5 @2.986 @3.583 @4.3 @5.16 ilcmssb8 3 4 5 @2.986 @3.583 @4.3 ilcmssi8 3 4 5 @2.986 @3.583 @4.3 lasy8 3 4 5 @2.986 @3.583 @4.3 lcmss8 3 4 5 @2.986 @3.583 @4.3 @5.16 lcmssb8 3 4 5 @2.986 @3.583 @4.3 lcmssi8 3 4 5 @2.986 @3.583 @4.3 -- -------------------------------------- rusty c. wright rusty@violet.berkeley.edu ucbvax!violet!rusty