home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 12 Font / 12-Font.zip / PFMAFM.ZIP / READ.ME < prev   
Text File  |  1991-09-22  |  5KB  |  104 lines

  1. As an OS/2 user, you may have noticed that there are many Adobe ATM fonts
  2. available for Windows.  If you tried to use them, you probably found
  3. a few that had both the .PFB and .AFM files you needed, but most of the
  4. fonts available had a Windows .PFM file instead of the standard Adobe
  5. .AFM file.  The PFM files are binary versions of the AFM's. Unfortunately, 
  6. there was no way to convert them to the AFM format.
  7.  
  8. Included here are some tools to create the necessary AFM files. 
  9. The PFM2AFM program will produce a useable AFM file:
  10.    PFM2AFM FONT.PFM >FONT.AFM
  11.  
  12. The resulting AFM file will be useable, but not totally correct. If you 
  13. stop with this step, you may find that some of the spacings are incorrect
  14. or that characters are clipped.  This is partly due to my laziness (the
  15. programs were written very quickly for my own use) and partly due to the 
  16. fact that the PFM file doesn't contain all of the needed data. 
  17.  
  18. The AFM file can be improved with a bit of editing (this is the laziness 
  19. part, I could have done it in the code).  If you look at the PFB file, you
  20. will see that the beginning is similar to the AFM file.  The values given
  21. are the closest I could get from the PFM, but aren't correct. 
  22. The FontBBox is almost certainly wrong as is the weight.  Fix the AFM file
  23. with the values from the PFB.  
  24.  
  25. A little ways down in the AFM you will find a line with:
  26.    StartCharMetrics <num>
  27.  
  28. This is followed by <num> lines describing each character. Beyond that is 
  29. the kerning data.  The kerning data starts with:
  30.    StartKernData
  31.    StartKernPairs <num>
  32.  
  33. and <num> lines of kerning pairs.  The CharMetrics gives the character
  34. number, its width, name and bounding box.  Everything is fine except the
  35. bounding box.  Windows doesn't have that data in the PFM file.
  36.  
  37. No, the names may be wrong too.  I can't find the correct standard names.
  38. Many (but not all) of the fonts give names in the ASCII part.  I don't 
  39. think it matters unless you use the high characters.  The low (i.e. <127)
  40. characters don't seem to change.
  41.  
  42. The KernPairs is fully specified in the PFM file and should be correct.
  43.  
  44. It is possible to get correct CharMetrics if you have a Postscript printer.
  45. The GETAFM.PS (from Pipeline Associates, Inc. and download from Bix) file 
  46. can be downloaded through the serial port to generate the CharMetrics.
  47.  
  48. You need to download the desired font to the printer.  Note: PFB files are
  49. binary and Postscript printers can only take ASCII data.  The PFB2PFA
  50. program will convert the binary PFB to ASCII:
  51.    PFB2PFA FONT.PFB >FONT.PFA
  52.  
  53. Edit GETAFM.PS at the bottom to specify the font name and use your favorite
  54. communications program to download the font and GETAFM.PS to the printer. 
  55. The printer should respond with an AFM file that can be captured. Cut 
  56. the CharMetrics section out and place it in the AFM file generated above
  57. and you will have a perfect Adobe Type Manager font for use with OS/2.
  58.  
  59. Summary:
  60. o  Generate a usable, but less than correct AFM file.
  61.       PFM2AFM font.pfm >font.afm
  62.  
  63. o  Fix up the AFM file with the information from the top, ASCII, part of
  64.    the PFB file.
  65.  
  66. o  If you have a Postscript printer that can be configured for serial
  67.    communications, use the PFB2PFA program to create an ASCII version of
  68.    the font and then use the GETAFM.PS Postscript program to generate the
  69.    correct CharMetrics.  The fonts are large, and serial communication is
  70.    slow.  Go have a cup (or five) of coffee while you are waiting.
  71.  
  72.  
  73. Disclaimers and so forth.
  74.  
  75. As I said above, these are 'quick and dirty' programs.  The error checking
  76. is minimal to nonexistent.  They will either work without complaint, or 
  77. blow up real bad.  I am assuming that you will only try to convert valid
  78. fonts.
  79.  
  80. The Windows PFM documentation is somewhat skimpy.  Much of the data that an
  81. AFM file requires is not in the PFM file, so I had to take values that looked
  82. like they should be close.
  83.  
  84. In any event, I have supplied the source code so feel free to fix things up.
  85. Of particular use would be a way to automatically retrieve the data from 
  86. the PFB file that is not in the PFM file.  If someone would like to do this
  87. and BixMail it to me, I'd appreciate it.  I'd really like to see someone
  88. create AFM's for all of the Windows fonts on Bix and post them in the OS2
  89. areas.
  90.  
  91. I hereby place these programs (PFM2AFM.C and PFB2PFA.C) into the Public
  92. Domain.  This abdicates my legal rights to your use of the programs.
  93. It would be considered a kindness if you would retain mention of my name
  94. as the author, however.
  95.  
  96. The GETAFM.PS program is not mine and is copyrighted by its author.  
  97.  
  98. Various trademarks are used above without credit.  This is not an attempt
  99. to challenge those trademarks, but is due to sloth.
  100.  
  101. I can be reached on Bix as Nickerson.
  102.  
  103. Kevin Nickerson.
  104.