freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Freetype] FT_Attach_File, .afm, .pfa, .pfb, etc


From: Ian Britten
Subject: [Freetype] FT_Attach_File, .afm, .pfa, .pfb, etc
Date: Mon, 21 Jan 2002 13:09:03 -0400

Hi all,
We're doing some work with Freetype, and are looking to use PostScript fonts,
in addition to Truetype.

Basically, I'm looking to spin over a bunch of directories (such as the font
server font path), and load the fonts that are encountered.  I'm trying to
decide which ones are useable, and which are duplicates, etc.

As I've learned, PostScript fonts are spread across as many as 3(?) files,
.afm, .pfa, and .pfb.  Are there others?
- It seems that the .pfa/.pfb files are basically the same, except that one
  is ascii and one is binary.  Correct?  Is one 'better' than the other?
- The .afm file seems to contain 'extra' stuff, such as kerning info, etc.
  It seems that the .afm file would be needed to get logically correct 
  results from Freetype, and that I might want to skip fonts that don't have
  an AFM file?  Maybe?

I discovered FT_Attach_File, which indicates it is for use for fonts that
are spread across multiple files.

So, my question is, when should I use this, and which files may be attached
to which others?  Do I (Should I) attach a .pfb to a .pfa?  Does it matter
what I attach a .afm file to?  Does Freetype automatically attach any
files (ie If they're in the same directory), or do I need to do it all
explicitely myself?

As to some specific examples I've run into:
- Consider the 'Bitstream Charter Bold' (AKA CharterBT-Bold) font.  I've
  discovered that XFree86-4.0.1-28mdk installs
  /usr/X11R6/lib/X11/fonts/Type1/c0632bt_.pfb, while
  ghostscript-fonts-5.50-5mdk installs
  /usr/share/fonts/default/ghostscript/bchb.pfa AND
  /usr/share/fonts/default/ghostscript/bchb.afm

  Should these be considered the same fonts?  Is one preferred (better)
  than the other?  Can I 'attach' the AFM to either one?  Should I be
  making both available to the user, distinguishing by something more than
  just the name of the font (ie foundary?, filename?, etc), or should I
  detect they're the same (assuming they are) and just use one of them?

- Consider the fonts-type1-baltic-1.0-4mdk package, which installs the
  AFMs in a different directory than the PFBs.
  I'm thinking that I'll need to list+scan both directories.  But this
  brings up the question - If I encounter an arbitrary AFM file, can I
  'attach' that to a face with the same font name, or do I need to
  somehow sync these files, and only attach the AFM to the 'correct'
  PFA/PFB file?
  (This is kindof like the first example:  If I opened
  /usr/X11R6/lib/X11/fonts/Type1/c0632bt_.pfb first, can/should I attach
  /usr/share/fonts/default/ghostscript/bchb.afm to it?)

Anyways, I don't need every question answered.  I'm just hoping that
someone can summarize the correct approach to take...
Thanks!
Ian



reply via email to

[Prev in Thread] Current Thread [Next in Thread]