#!/bin/sh # # =================================================================== # M Goossens, S Rahtz. June 10 1995. revised December 5th 1995, March 1997 # # Given a multiple master font, and values for up to 4 design space # variables (how many, depends on the font), create AFM instances by # creating normalized weight factors, and applying them to the master # AFM files. # # Procedure: # 1. create small PS file to invoke MM operators in PostScript # with right values # 2. run GhostScript on file to derive normalized weights # 3. run mmafm program to read master AFM files and write new one # 4. write map entry and .pro header file # =================================================================== #echo "usage makeinstance fontname instancename design-space-variables 1 to 4" X=$2.control cat > $$.instance < $$.ps rm $$.instance gs -dNODISPLAY `kpsewhich -format=.pfa $1.PFA` $$.ps quit.ps rm $$.ps #---------------------------------- # # build control file for mmafm # #---------------------------------- # number of weights wc -l myfile | awk '{print $1}' > $X # master AFM file names cat $1.afmnames >> $X # new name echo $2 >> $X # weights cat myfile >> $X #---------------------------------- rm myfile mmafm $X | \ sed -e "/^FontName/s/^FontName .*$/FontName $1-$3-$4-$5-$6/" \ -e "/^FontName/s/-*$//" > $2.afm #---------------------------------- echo "/$2 /$1 findfont dup begin [" > $2.pro echo " $V1 $V2 $V3 $V4 NormalizeDesignVector ConvertDesignVector" >>$2.pro echo " ] end makeblendedfont definefont pop " >>$2.pro #---------------------------------- exit