Article View: comp.fonts
Article #2705comp.fonts FAQ.9.Utilities
From: Norman Walsh
Date: Mon, 21 Jun 1993 13:19
Date: Mon, 21 Jun 1993 13:19
544 lines
21815 bytes
21815 bytes
Posted-By: auto-faq 2.4
Archive-name: fonts-faq/part11
Version: 1.4.1
Subject: Chapter 9
Utilities
Subject: 9.1. Notes about the utilities
I have just started collecting information about font utilities. I
will gladly add any information that you can pass my way. Please
send your submissions to norm <walsh@cs.umass.edu>.
I would appreciate it if you could include a paragraph or so of
description and the appropriate site/filename for retrieval.
Subject: 9.2. PS2PK
PS2PK is a utility for converting Type1 postscript fonts into TeX
PK files. The source code is distributed and it has been compiled
for both *nix boxes and MS-DOS based machines.
Here is the original announcement:
Ps2pk-1.2 available
-------------------
(June 1992)
Version 1.2 of ps2pk is now available on:
ftp.urc.tue.nl (address: 131.155.2.79)
directory: /pub/tex
files: ps2pk12.README ( 1k) This file
ps2pk12.tar.Z (391k) Sources
ps2pk386.zip (232k) MSDOS executables
utopia.tar.Z (342k) Adobe Utopia font family
courier.tar.Z (207k) IBM Courier font family
For people having difficulties in handling UNIX `.tar.Z' format I
have made some UNIX tools (only executables) available in:
directories: /pub/unixtools/dos
/pub/unixtools/vms
See the system specific TARZ file for some help.
Ftp.urc.tue.nl can not handle E-mail requests. But sites are free
to put the ps2pk12 stuff on any server that can.
9.2.1. When do you need ps2pk?
Ps2pk is a tool that converts a PostScript type1 font into a
corres- ponding TeX PK font. The tool is especially interesting if
you want to use fully hinted type1 fonts in your DVI previewer
(instead of the unhinted type1 fonts currently used in GhostScript)
or on a printer that has no PostScript interpreter.
In order to use the ps2pk generated fonts your driver and previewer
need to support virtual fonts. The reason is that PostScript fonts
and TeX fonts do have a different font encoding and handle
ligatures in a different way. With virtual fonts the PostScript
world (encoding + ligatures) can be mapped to the old style TeX
world on which the current plain macro packages still are based
(despite the fact that TeX3.0 can handle 8bits).
It is also possible to use the ps2pk generated PK fonts directly
In addition, a modified version of PS2PK exists on
ibis.cs.umass.edu. I have added some hacks to better support
really large renderings and a primitive ``range'' facility.
Subject: 9.3. TeX Utilities
There are many TeX font utilities. For TeX related questions, I
direct you to comp.text.tex or the Info-TeX mailing list. I will
happily list any utilities here that the comp.fonts public feels
should be present. I am listing MetaFont because it is the obvious
font-specific component of TeX and PKtoSFP because it allows anyone
to use PS2PK to create LaserJet softfonts.
Liam R. E. Quin <lee@sq.com> is the original author of the MetaFont
section. It has been hacked at a bit by norm to make it fit the
tone of the comp.fonts FAQ. Assume that norm is responsible for any
errors, not Liam.
* MetaFont
* About MetaFont:
Metafont is a programming language for describing fonts. It
was written by Donald Knuth and is documented in
Computers & Typesetting/C: The METAFONTbook
Knuth, Donald E.
Addison Wesley, 1986
ISBN 0-201-13445-4, or 0-201-13444-6 (soft cover)
Library access: Z250.8.M46K58, or 686.2'24, or 85-28675.
A font written in MetaFont is actually a computer program
which, when run, will generate a bitmap (`raster') for a given
typeface at a given size, for some particular device.
* What do you need in order to use the fonts:
You cannot print the MetaFont fonts directly (unless you want
a listing of the program, that is). Instead, you must generate
a bitmap font and use that to print something.
If you are using TeX, the sequence of steps is something like
this:
MF -> metafont -> GF [ convert MetaFont program into bitmap font ]
TFM [ and metric information ]
GF -> gftopk -> PK [ represent the bitmapped font efficiently ]
TEX -> tex -> DVI [ TeX -> device independent output ]
TFM
DVI -> dvi2xxx -> XXX [ DVI -> output device format ]
PK
XXX -> printer -> hardcopy [ print the output ]
The above steps are idealized. In reality, you have to make
sure that the fonts get installed in the correct places and
you may have to adjust description files, etc. The friendly
folks on comp.text.tex can probably get it staightened out for
you if you can't find a local guru.
If you are not using TeX, it's almost impossible to predict.
At some point in the above sequence, you'll insert some other
conversion program and proceed differently. Here, for example,
is how you might use TeX fonts with WordPerfect and a LaserJet
printer.
PK -> PKtoSFP -> SFP [ PK to LaserJet softfont ]
SFP -> SFP2Auto -> TFM [ Make HP AutoFont TFM file ]
SFP -> PTR -> installation [ Install the fonts into WP ]
TFM
Use WordPerfect as you normally would.
Subject: 9.4. MFpic
MFpic is a macro package for including pictures in TeX documents.
The idea behind this package is to have Metafont do the actual
drawing, and store the pictures in a font that TeX can include in
the document. The macros have been designed so that the user should
never have to learn Metafont to use these macros -- the TeX macros
actually write the Metafont file for you.
Subject: 9.5. fig2MF
Briefly, fig2MF uses the mfpic macros to create formatted,
commented MF code from the fig graphics language. This means that
programs like xfig can be used as interactive font creation tools.
I wrote fig2MF so that I could portably illustrate TeX documents,
but I suppose one could use it to design letterforms as well.
The package consists of a single C source code file, modified mfpic
macros, documentation, and sample fig files. It is available at the
shsu archives.
Subject: 9.6. GNU Font Utilities
Here is a brief description of the programs included:
* imageto extracts a bitmap font from an image in PBM or IMG
format, or converts the image to Encapsulated PostScript.
* xbfe is a hand-editor for bitmap fonts which runs under X11.
* charspace adds side bearings to a bitmap font.
* limn fits outlines to bitmap characters.
* bzrto converts a generic outline font to Metafont or PostScript.
* gsrenderfont renders a PostScript outline font at a particular
point size and resolution, yielding a bitmap font.
* fontconvert can rearrange or delete characters in a bitmap font,
filter them, split them into pieces, combine them, etc., etc.
* imgrotate rotates or flips an IMG file.
We need volunteers to help create fonts for the GNU project. You do
not need to be an expert type designer to help, but you do need to
know enough about TeX and/or PostScript to be able to install and
test new fonts. Example: if you know neither (1) the purpose of TeX
utility program `gftopk' nor (2) what the PostScript `scalefont'
command does, you probably need more experience before you can
help.
If you can volunteer, the first step is to compile the font
utilities. After that, contact me (karl@gnu.ai.mit.edu). I will get
you a scanned type specimen image. The manual explains how to use
these utilities to turn that into a font you can use in TeX or
PostScript.
You can get the source by ftp from prep.ai.mit.edu [ 18.71.0.38 ] :
pub/gnu/fontutils-0.5.tar.Z.
And also from these other sites around the world; please check them
before prep.
United States: wuarchive.wustl.edu gatekeeper.dec.com:pub/GNU
uxc.cso.uiuc.edu ftp.uu.net:packages/gnu
Europe: archive.eu.net src.doc.ic.ac.uk:gnu ftp.funet.fi
nic.funet.fi:pub/gnu ugle.unit.no isy.liu.se
ftp.diku.dk
elsewhere: ftp.cs.titech.ac.jp utsun.s.u-tokyo.ac.jp:ftpsync/prep
archie.au:gnu
You can also order tapes with GNU software from the Free Software
Foundation (thereby supporting the GNU project); send mail to
gnu@prep.ai.mit.edu for the latest prices and ordering information,
or retrieve the file DISTRIB from a GNU archive.
Subject: 9.7. Font editors
* Editors for BDF fonts
There is a bdf font editor that comes with HP/Apollo
workstations. It's called 'edfont'. It's not the best but it
works.
Gary <Gocek.Henr801C@Xerox.COM> reports:
The standard X distribution for X11R5 contains ``xfed'', which
allows you to play with BDF fonts. ``xfedor'' has a more
elaborate user interface, and is available on most contrib
directories.
The last time I tried:
``xfedor'' couldn't handle BDF files with more than 256
characters.
``xfed'' aborts if the BDF file contains a COMMENT line with no
other text. The workaround is to edit the BDF file, to put text
after the word COMMENT. A single blank space is sufficient. For
some reason, the standard BDF files included in the X release
contain blank spaces on the otherwise empty COMMENT lines. It was
probably easier to add the space to the COMMENT lines of every
BDF file than it was to fix the lex code for xfed. :-)
* Editors for PK fonts
The GNU font utilities include an X-based editor called Xbfe
which edits bitmapped fonts under X.
Eberhard Mattes' emTeX includes PKedit.
Subject: 9.8. t1utils
This is a snippet from the README file for I. Lee Hetherington's
<ilh@lcs.mit.edu> t1utils package:
t1utils is a collection of simple type-1 font manipulation
programs. Together, they allow you to convert between PFA (ASCII)
and PFB (binary) formats, disassemble PFA or PFB files into
human-readable form, reassemble them into PFA or PFB format.
Additionally you can extract font resources from a Macintosh font
file (ATM/Laserwriter).
Subject: 9.9. Where to get bitmap versions of the fonts
There are archives containing the bitmaps of many of these fonts at
various sizes and resolutions. The fonts must have been generated
for the correct print engine: e.g. write-white or write-black. The
archives generally hold only the sizes used by TeX. These are
`magstep' sizes, and are not exact point sizes. It is probably
better to generate them from the Metafont sources yourself if you
can.
The best place to look for raster fonts was almost certainly:
mims-iris.waterloo.edu
but it isn't any more, the fonts have all gone. Let me know if you
find them elsewhere. Most people seem to have moved to using
PostScript fonts or Bitstream ones instead now.
Some other sites are:
ctrsci.math.utah.edu (128.110.198.1)
science.utah.edu (128.110.192.2)
ymir.claremont.edu (134.173.4.23)
The occasional posting of ftp sites to comp.misc and comp.archives
lists these and several other sites.
Subject: 9.10. Converting between font formats
Conversions to and from pbm and pk format were posted to
comp.text.tex and to alt.sources on the 9th of August, 1990 by
Angus Duggan (ajcd@cs.ed.ac.uk). The program is pbmtopk, and there
are also at least two patches.
Chris Lewis' psroff package includes a program to go from pk both
to the HP LaserJet and to PostScript.
John McClain (ophelp@tamvenus.bitnet) has some conversion programs
for various graphics formats to/and from pk files.
A PC program, CAPTURE, turns HPGL files into PK format, US $ 130
from Micro Programs Inc., 251 Jackson Ave., Syosset, NY 11791
U.S.A.
Metaplot can take pen-plotter files and prouce metafont files.
Note: Pat Wilcox is no longer at Ohio State.
Kinch Cmputer Company sell .pk fonts derived from PostScript fonts.
Kinch Computer Co., 501 S. Meadow St.Ithaca, NY 14850 U.S.A.
telephone: +1 607 273 0222; fax: +1 607 273 0484
Subject: 9.11. Getting fonts by FTP and Mail
If you are using ftp, you will need either the name of the host or
the Internet number. For example, to connect to ymir, listed as
ftp: ymir.claremont.edu [ 134.173.4.23 ] you will need to type
something like
ftp ymir.claremont.edu
If that doesn't work, try using the number:
ftp 134.173.4.23
If that doesn't work, on Unix systems you can use nslookup (it's
usually /usr/etc/nslookup) to find the host number -- it might have
changed. Type the entire host name, and after a few seconds
nslookup will give you the address.
Once you have connected, you will need to go to the appropriate
directory, lists its contents, and retrieve the files.
Most of the machines listed here run Unix, and you use ``ls'' and
``cd'' to list files and to change directories. Ymir runs VMS, and
you will have to put square brackets around directory names, like [
this ] .
Remember that although Metafont sources are text files, pk fonts
are not ASCII, and you will have to use binary mode for them. In
general, use text mode for README files and *.mf files, and binary
mode for other font files. Files ending in .Z are compressed binary
files -- you will need to use binary mode, and then uncompress the
files when you get them.
You can get files from ymir by sending mail messages to
mailserv@ymir.claremont.edu
For example,
send [ tex.mf.misc ] cmapl10.mf
will get the file cmapl10.mf from the directory ``tex.mf.misc''.
You can't get binary files in this way.
There is an ftp-by-mail BITNET service, BITFTP, for BITNET users.
Before getting large files by mail, please remember to get
permission from all intervening sites. Ask your site administrator,
who can send mail to Postmaster at each site on the way if
necessary.
Subject: 9.12. Metafont to PostScript conversion
There are (I believe) two programs that perform this task. At least
one of them is called ``mf2ps''. If you have any more information
about these tools, please let me know.
Chang Jin-woong reports that he found the ``mf2ps'' package with
Archie. It is written by Shimon Yanai <yanai@israearn.bitnet> and
Daniel M. Berry <dberry@cs.technion.ac.il>. The source programs are
written in Pascal.
Subject: 9.13. How to use Metafont fonts with Troff
If, when you run troff, you get the message `typesetter busy', you
have the original Ossanna-troff, also called otroff. Chris Lewis
has a package which will let you use TeX fonts with troff -- it's
called psroff, and comes with documentation.
ftp: gatekeeper.dec.com (16.1.0.2) pub/misc/psroff-3.0
ftp: ftp.cs.toronto.edu [128.100.1.105] pub/psroff-3.0/*
If, when you run troff, you get something like this:
x T 300
x res 300 1 1
you have ditroff. This is sometimes called titroff or psroff. In
this case, you will probably need to do the following:
1. convert the font to your printer's format
2. generate a width table for the font
3. add the font to the DESC file for the appropriate device
4. arrange for troff to download the font
5. tell troff about the font by running `makedev DESC' in the right
place.
If, when you run troff, you get something like this:
X hp(SCM)(CM)(AF)(AD) 300 1 1
Y P default letter 2550 3300 0 0 90 90 2460 3210
you have sqtroff:
1. convert the font to your printer's format
2. generate a width table for the font
3. add the font to the DESC file for the appropriate device
4. put the font in the appropriate raster directory
5. tell sqtroff about the font by running `sqmakedev DESC' or
`sqinstall'.
In each case, you should be able to get help from your vendor.
Note that Chris Lewis' psroff package has software to make width
tables for troff from pk files.
Subject: 9.14. PKtoBDF / MFtoBDF
From the SeeTeX distribution, programs to help previewers under
X11.
Subject: 9.15. PKtoPS
Included in the psroff distribution, this utility converts PK fonts
into PostScript fonts (bitmaps, I presume). If you have any more
information about these tools, please let me know.
Subject: 9.16. PKtoSFP/SFPtoPK
Convert fonts from TeX PK format to HP LaserJet (bitmap) format.
Subject: 9.17. PostScript to Metafont
ps2mf started out as a way of creating bitmaps via MF for TeX.
Only, when I had just finished it, Piet Tutelaers came with ps2pk.
This was a far superior way runtime-wise. He uses the IBM X11-R5
fontutilities library, which is extremely ugly code. But, it works.
So, to generate bitmaps, I suggest everyone use ps2pk.
To generate a MF outline description, ps2mf is *the* tool. Yannis
Haralambous has just started a project where he wants to create
meta-ized fonts for MF from Postscript descriptions. ps2mf does the
basic conversion. This project wants to revive the use of MF for it
is a truly beautiful program with enormous possiblities.
The following information comes from the README file for ps2mf:
This is pfb2mf. It is a copyleft program. See the file COPYING for
more details. I suggest that for the translation of Type-One to
readable PostScript you use I. Lee Hetherington's Type-1-Utils. You
can find these somewhere on obelix.icce.rug.nl in pub/erikjan.
If you find any bugs, please do report.
If you have any complaints, please do report.
Now for some info about the different stages. This package contains
four programs:
* pfb2pfa
* pfa2chr
* chr2ps
* ps2mf
9.17.1. pfb2pfa
pfb2pfa will decompress an IBM (!) Postscript type 1 fontfile into
readable and downloadable hexadecimal data.
The resulting file still contains two layers of encryption:
- eexec encryption
- charstring encryption
9.17.2. pfa2chr
pfa2chr will do an eexec-decryption of a readable hexadecimal font
file to a fontfile with encrypted charstrings.
9.17.3. chr2ps
chr2ps will perform a charstring-decryption of a font file with
encrypted charstrings to fontfile with postscript commands for type
1 fonts.
With a ``-'' as filename, these programs will read from <stdin> and
write to <stdout>. This way you can pipe the results, as in:
pfb2pfa garmnd - | pfa2chr - - | chr2ps - garmnd
This will create a <garmnd.ps> from <garmnd.pfb> without
explicitely creating the intermediate files.
These previous stages can be replaced by (when using Lee
Hetherington's type-1-utils):
t1disasm garmnd.pfb garmnd.ps
9.17.4. ps2mf
This last stage will convert to a MetaFont program with the use of
the corresponding <.afm> file and a mapping configuration file. It
can convert to an ordinary form with B'ezier controlpoints. It can
also generate a curl specification. For this last option specifify
-C.
Subject: 9.18. Converting Mac Bitmaps to BDF Format
I have posted a program which I hacked together for extracting all
NFNT and FONT resources from a MacBinary form of a standard Mac
file and dumping the fonts as Adobe BDF files. It has only been
compiled and tested on a Sun system to date. It can be fetched from
METIS.COM, /pub/mac2bdf.c.
I wrote this tool to be able to use Mac Bitmaps under X Windows and
OpenWindows (which take Adobe BDF format files).
Technical Details
Message-ID:
<fonts-faq-11-740668866@cs.umass.edu>Path:
arc1-ca.pugleaf.net!senator-bedfellow.mit.edu!enterpoop.mit.edu!gatech!howland.reston.ans.net!noc.near.net!nic.umass.edu!ymir.cs.umass.edu!ymir.cs.umass.edu!usenetReferences:
<fonts-faq-1-740668866@cs.umass.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!senator-bedfellow.mit.edu!enterpoop.mit.edu!gatech!howland.reston.ans.net!noc.near.net!nic.umass.edu!ymir.cs.umass.edu!ymir.cs.umass.edu!usenet
From: walsh@cs.umass.edu (Norman Walsh)
Newsgroups: comp.fonts,comp.answers,news.answers
Subject: comp.fonts FAQ.9.Utilities
Followup-To: poster
Date: 21 Jun 1993 13:19:22 GMT
Organization: Dept of Comp and Info Sci, Univ of Mass (Amherst)
Lines: 545
Approved: news-answers-request@MIT.Edu
Distribution: world
Message-ID: <fonts-faq-11-740668866@cs.umass.edu>
References: <fonts-faq-1-740668866@cs.umass.edu>
Reply-To: walsh@cs.umass.edu (Norman Walsh)
NNTP-Posting-Host: ibis.cs.umass.edu
Summary: This posting answers frequently asked questions about fonts.
It addresses both general font questions and questions that
are specific to a particular platform.