home *** CD-ROM | disk | FTP | other *** search
- 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
-
- 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 [for
- improvements, see below] (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
-
- [FOR THE PFB2PFA.EXE-FILE, SEE THE ORIGINAL ARCHIV BY KEVIN IN BIX!]
-
- 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.
-
-
-
- --------------------------------------------------------------------------
- Yeah, someone did it.
-
- I had some problems
- o If font-famlilies were converted, Textprocessors showed each font
- for semselfes (e.g. Times-Bold, Times-Italic etc.) instead of
- grouping them.
- o There was a bug in the table of characters higher than 128.
- (bad to be a european :-)
-
- Now the Program looks for a pfb-file and tries to extract some data
- (ItalicAngle, FontBBox, Weight, FamilyName) from there. If the data
- is not there (I found out, that not all pfb-files contain ascii-data)
- it tries to guess them from the font name by looking for words like
- "Bold, Italic, Heavy" and so on.
-
- For sake of batch-processing I changed the command-line-parameters a
- bit. Call it with a pfm-file and it builds the names of afm/pfb-files
- for itself. Convert all your files with
-
- CONVALL.CMD:
- for %%a in (*.PFM) do pfm2afm %%a
-
-
- Markus Schmidt, Internet: m.schmidt@msn.rmi.DE
-