| 1 |
//======================================================================== |
| 2 |
// |
| 3 |
// FoFiIdentifier.h |
| 4 |
// |
| 5 |
// Copyright 2009 Glyph & Cog, LLC |
| 6 |
// |
| 7 |
//======================================================================== |
| 8 |
|
| 9 |
#ifndef FOFIIDENTIFIER_H |
| 10 |
#define FOFIIDENTIFIER_H |
| 11 |
|
| 12 |
#include <aconf.h> |
| 13 |
|
| 14 |
class GList; |
| 15 |
|
| 16 |
//------------------------------------------------------------------------ |
| 17 |
// FoFiIdentifier |
| 18 |
//------------------------------------------------------------------------ |
| 19 |
|
| 20 |
enum FoFiIdentifierType { |
| 21 |
fofiIdType1PFA, // Type 1 font in PFA format |
| 22 |
fofiIdType1PFB, // Type 1 font in PFB format |
| 23 |
fofiIdCFF8Bit, // 8-bit CFF font |
| 24 |
fofiIdCFFCID, // CID CFF font |
| 25 |
fofiIdTrueType, // TrueType font |
| 26 |
fofiIdTrueTypeCollection, // TrueType collection |
| 27 |
fofiIdOpenTypeCFF8Bit, // OpenType wrapper with 8-bit CFF font |
| 28 |
fofiIdOpenTypeCFFCID, // OpenType wrapper with CID CFF font |
| 29 |
fofiIdDfont, // Mac OS X dfont |
| 30 |
fofiIdUnknown, // unknown type |
| 31 |
fofiIdError // error in reading the file |
| 32 |
}; |
| 33 |
|
| 34 |
class FoFiIdentifier { |
| 35 |
public: |
| 36 |
|
| 37 |
// Identify a font file. |
| 38 |
static FoFiIdentifierType identifyMem(char *file, int len); |
| 39 |
static FoFiIdentifierType identifyFile(char *fileName); |
| 40 |
static FoFiIdentifierType identifyStream(int (*getChar)(void *data), |
| 41 |
void *data); |
| 42 |
|
| 43 |
// Return a list of font names (GString *) in a font collection |
| 44 |
// file. Indexes into the returned list are indexes into the |
| 45 |
// collection. This function is only useful with TrueType |
| 46 |
// collections and Mac dfont files. Returns NULL on error |
| 47 |
// (including invalid font type). |
| 48 |
static GList *getFontList(char *fileName); |
| 49 |
}; |
| 50 |
|
| 51 |
#endif |