home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 12 Font
/
12-Font.zip
/
PFMAFM.ZIP
/
READ.ME
< prev
Wrap
Text File
|
1991-09-22
|
5KB
|
104 lines
As an OS/2 user, you may have noticed that there are many Adobe ATM fonts
available for Windows. If you tried to use them, you probably found
a few that had both the .PFB and .AFM files you needed, but most of the
fonts available had a Windows .PFM file instead of the standard Adobe
.AFM file. The PFM files are binary versions of the AFM's. Unfortunately,
there was no way to convert them to the AFM format.
Included here are some tools to create the necessary AFM files.
The PFM2AFM program will produce a useable AFM file:
PFM2AFM FONT.PFM >FONT.AFM
The resulting AFM file will be useable, but not totally correct. If you
stop with this step, you may find that some of the spacings are incorrect
or that characters are clipped. This is partly due to my laziness (the
programs were written very quickly for my own use) and partly due to the
fact that the PFM file doesn't contain all of the needed data.
The AFM file can be improved with a bit of editing (this is the laziness
part, I could have done it in the code). If you look at the PFB file, you
will see that the beginning is similar to the AFM file. The values given
are the closest I could get from the PFM, but aren't correct.
The FontBBox is almost certainly wrong as is the weight. Fix the AFM file
with the values from the PFB.
A little ways down in the AFM you will find a line with:
StartCharMetrics <num>
This is followed by <num> lines describing each character. Beyond that is
the kerning data. The kerning data starts with:
StartKernData
StartKernPairs <num>
and <num> lines of kerning pairs. The CharMetrics gives the character
number, its width, name and bounding box. Everything is fine except the
bounding box. Windows doesn't have that data in the PFM file.
No, the names may be wrong too. I can't find the correct standard names.
Many (but not all) of the fonts give names in the ASCII part. I don't
think it matters unless you use the high characters. The low (i.e. <127)
characters don't seem to change.
The KernPairs is fully specified in the PFM file and should be correct.
It is possible to get correct CharMetrics if you have a Postscript printer.
The GETAFM.PS (from Pipeline Associates, Inc. and download from Bix) file
can be downloaded through the serial port to generate the CharMetrics.
You need to download the desired font to the printer. Note: PFB files are
binary and Postscript printers can only take ASCII data. The PFB2PFA
program will convert the binary PFB to ASCII:
PFB2PFA FONT.PFB >FONT.PFA
Edit GETAFM.PS at the bottom to specify the font name and use your favorite
communications program to download the font and GETAFM.PS to the printer.
The printer should respond with an AFM file that can be captured. Cut
the CharMetrics section out and place it in the AFM file generated above
and you will have a perfect Adobe Type Manager font for use with OS/2.
Summary:
o Generate a usable, but less than correct AFM file.
PFM2AFM font.pfm >font.afm
o Fix up the AFM file with the information from the top, ASCII, part of
the PFB file.
o If you have a Postscript printer that can be configured for serial
communications, use the PFB2PFA program to create an ASCII version of
the font and then use the GETAFM.PS Postscript program to generate the
correct CharMetrics. The fonts are large, and serial communication is
slow. Go have a cup (or five) of coffee while you are waiting.
Disclaimers and so forth.
As I said above, these are 'quick and dirty' programs. The error checking
is minimal to nonexistent. They will either work without complaint, or
blow up real bad. I am assuming that you will only try to convert valid
fonts.
The Windows PFM documentation is somewhat skimpy. Much of the data that an
AFM file requires is not in the PFM file, so I had to take values that looked
like they should be close.
In any event, I have supplied the source code so feel free to fix things up.
Of particular use would be a way to automatically retrieve the data from
the PFB file that is not in the PFM file. If someone would like to do this
and BixMail it to me, I'd appreciate it. I'd really like to see someone
create AFM's for all of the Windows fonts on Bix and post them in the OS2
areas.
I hereby place these programs (PFM2AFM.C and PFB2PFA.C) into the Public
Domain. This abdicates my legal rights to your use of the programs.
It would be considered a kindness if you would retain mention of my name
as the author, however.
The GETAFM.PS program is not mine and is copyrighted by its author.
Various trademarks are used above without credit. This is not an attempt
to challenge those trademarks, but is due to sloth.
I can be reached on Bix as Nickerson.
Kevin Nickerson.