home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!uwm.edu!caen!nic.umass.edu!dime!dime.cs.umass.edu!walsh
- From: walsh@cs.umass.edu (Norman Walsh)
- Newsgroups: comp.fonts
- Subject: Re: Does a pfb & pfm to bdf font convertor exist?
- Message-ID: <WALSH.92Nov16112032@ibis.cs.umass.edu>
- Date: 16 Nov 92 16:20:32 GMT
- Article-I.D.: ibis.WALSH.92Nov16112032
- References: <92312.183945CXF111@psuvm.psu.edu> <SIMON.92Nov9112743@liasg2.epfl.ch>
- <6730@m1.cs.man.ac.uk>
- Sender: news@dime.cs.umass.edu
- Reply-To: walsh@cs.umass.edu
- Organization: Dept of Comp and Info Sci, Univ of Mass (Amherst)
- Lines: 71
- In-reply-to: lilleyc@cs.man.ac.uk's message of 11 Nov 92 18:45:52 GMT
-
- The combination of PS2PK and PKtoBDF allow you to create X11 bitmap fonts
- from pfa/pfb files. I forget where I got PKtoBDF but I'm sure I found it
- with Archie. PS2PK is described in the FAQ.
-
- Here is a little script (based on TeXtoXfont from the SeeTeX distribution)
- that creates the appropriate X font from a pfa/pfb file:
-
- ------------------------------------------------------------------------
-
- #!/usr/local/bin/bash
- #
- # This script file makes a new X/TeX screen font, because one wasn't
- # found. Parameters are:
- #
- # name dpi bdpi mag mode destdir
- #
- # Of course, it needs to be set up for your site.
- #
- # TEMPDIR needs to be unique for each process because of the possibility
- # of simultaneous processes running this script.
-
- TEMPDIR=/tmp/bdf-PS.$$
- NAME=$1
- DPI=$2
- BDPI=$3
- MAG=$4
- MODE=$5
- DESTDIR=$6
-
- BASENAME=$NAME.$MAG.$BDPI
- PTSIZE=`echo "2 k $MAG 100 / p q" | dc`
- PFADIR=/usr/local/lib/tex/ps/outlines/
-
- # Clean up on normal or abnormal exit
- trap "cd /; rm -rf $TEMPDIR" 0 1 2 15
-
- mkdir $TEMPDIR
- cd $TEMPDIR
-
- echo Making ${PTSIZE}pt ${BDPI}dpi version of $NAME.
- ps2pk -v -X$BDPI -P$PTSIZE -a$PFADIR/$NAME.afm $PFADIR/$NAME.pfa $BASENAME.pk
- pktobdf $BASENAME.pk | gawk -vname=$NAME.$DPI -f /usr/local/lib/tex/ps/PStoXfont.awk > $BASENAME.bdf
- bdftopcf $BASENAME.bdf > $BASENAME.pcf
- mv $BASENAME.pcf $DESTDIR
-
- mkfontdir $DESTDIR
- xset +fp $DESTDIR
- xset fp rehash
-
- exit 0
-
- -------------------------------------------------------------------------
-
- Here's PStoXfont.awk. It just changes the "FONT" resource name in the BDF
- file to match what SeeTeX looks for...
-
- BEGIN { ok=1 }
- /^FONT / { printf("FONT %s\n",name)
- ok=0
- }
- { if (ok) print $0
- ok=1
- }
-
- -------------------------------------------------------------------------
-
- Be seeing you...
- norm
- ---
- Norman Walsh | University of Massachusetts, Amherst, MA 01003
- <walsh@cs.umass.edu> | CMPSCI Dept., LGRC A210 | Standard disclaimer applies
-