[Openfontlibrary] ccHost compression

George Williams gww at silcom.com
Wed Nov 5 20:21:44 PST 2008

On Mon, 2008-11-03 at 13:46, Ed Trager wrote:
> at the *nix "file" command source code, I bet you could fairly easily
> find a reference to the "magic" file header bytes that are used to
> detect TTF/OTF files and then add this to the getId3() stuff, assuming
> that getId3() is well-written.
OpenType fonts begin with the four bytes

TrueType fonts begin with either
   0x00020000        (I doubt this will occur in a user supplied font)

TTC fonts begin with

There are some ancient apple/adobe sfnt formats which start with
   "CID "
 but these aren't likely to be generated any more.

PFB files begin with
PFA files begin with
(Other adobe fonts probably also start with this, so it might just mean
PostScript font).
Bare CFF fonts (the thingies inside otf files) begin with

BDF fonts begin with

PCF fonts begin with
   0x01 "fcp"

sfd files begin with

Ikarus fonts begin with
   "IK" 0x0055

(There are some exceedingly complex rules for recognizing fonts in mac
resource forks, or mac dfont format (almost the same) but I doubt it's
worth implementing them).

On Tue, 2008-11-04 at 05:02, Brendan Ferguson wrote:
> Say, will any of the font source files read like a unix script file  
> with #!/ as the first bits of information in the file?
I am not aware of any font format which starts with "#!/"

On Tue, 2008-11-04 at 14:17, Dave Crossland wrote:
> I think with extensions and the "file" command we can reliably detect
> images as images and have them displayed instead of for download :-)
png images start with
  0x89 "PNG"
jpeg images contain "JFIF" in bytes 6,7,8,9
gif files start with

More information about the Openfontlibrary mailing list