[tex-live] perl script to install a postscript font into texlive2008

ivo welch ivo.welch at brown.edu
Sun Oct 5 23:21:36 CEST 2008


dear texperts---has anyone created a (perl or other) script that
installs a postscript font into texlive (2008)?  I have tried to follow
two different installation instructions on the web (which is probably
what screwed me up), but so far no cigar.

logically, if I understand the font installation inputs, it would seem
to me that I need to have only two input files, a pf[ab] file and an afm
file.  everything that needs to be done with them seems to be
perl-automatable.  So, I would like to volunteer to create a perl script
that does this for me and every other neophyte.

For example, say I have cp30a____.pfb and cp30a.afm in my current
directory.  If my script works,

  $ perl texlive-install-postscript-font.pl cp30a
  Font cp30a (zpcp30ab) installed (from cp30a____.pfb and cp30a.afm).
  Try 'pdftex testzpcp30a.tex' to see that it works.
  $


Now, if I understand the steps, here is what I need (in an obvious mix
of perl and bash right now):

   my $f= $ARGV[0];  ## this is 'cp30a'
   my $f_pfab = glob("$f*.[pP][fF][bB]");  # the type 1 font
   my $f_afm = glob("$f*.[a][fF][mM]");  # the afm file
   ((-e $f_pfab) and (-e $f_afm)) or die "Need correct input files.\n";
# check that I have them

   ## we could convert $f into karl berry's scheme.
   my $kb = karlberry($f)  ## now, $f would be zpcp30ab
   ## if lazy, I could probably use my $kb= $f;

   ## the following are all system commands:

   afm2tfm $f_afm -v $kb.vpl -p texnansi.enc $kb.tfm > $kb.id
   vptovf $kb.vpl $kb.vf $kb.tfm
   #
   mkdir -p ${TEXLIVE}/texmf-local/fonts/afm/$kb/
   cp $f_afm ${TEXLIVE}/texmf-local/fonts/afm/$kb/
   #
   mkdir -p ${TEXLIVE}/texmf-local/fonts/tfm/$kb/
   cp $kb.tfm ${TEXLIVE}/texmf-local/fonts/tfm/$kb/
   #
   mkdir -p ${TEXLIVE}/texmf-local/fonts/type1/$kb/
   cp $f_pfab ${TEXLIVE}/texmf-local/fonts/type1/$kb/
   #
   mkdir -p ${TEXLIVE}/texmf-local/fonts/vf/$kb/
   cp $kb.vf ${TEXLIVE}/texmf-local/fonts/vf/$kb/
   ##
   cp $kb.id ${TEXLIVE}/texmf-local/dvips/$kb.map
   echo "Map $kb.map" >> ${TEXLIVE}/2008/texmf/web2c/updmap.cfg
   ##
   texhash
   updmap

   ## here I would like to create a testfile that shows
   ## how to use the font after installation
   echo "\\font\\testme = $kb at 12 pt\n Hello, your font is working. \
\bye" > test$kb.tex

   ## and tell my user how to check that it worked
   print "Font $kb installed (from $f_pfab and $f_afm).\n"
   print "Try 'pdftex test$kb.tex' to see if it works.\n"

Could someone please let me know what steps I have missed?


Actually, given that this kind of script should not be difficult for
someone to write, provided this person knows the setup, I am a bit
surprised that it does not exist just yet.  If I keep each file name in
its own map file, a "delete font" and "list font" script would also be
easy to write.

Help appreciated.

Regards,

/iaw




More information about the tex-live mailing list