X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=pdf2swf%2Fxpdf%2FFoFiTrueType.h;fp=pdf2swf%2Fxpdf%2FFoFiTrueType.h;h=0000000000000000000000000000000000000000;hp=f7b09d6c0ab7ab261ff260c7ebada29f0fe1d1da;hb=5a005ef586b9000810156a961b9622c903dce988;hpb=c26ca847941ca0acfc9f3b4bdc519d904ba09a39 diff --git a/pdf2swf/xpdf/FoFiTrueType.h b/pdf2swf/xpdf/FoFiTrueType.h deleted file mode 100644 index f7b09d6..0000000 --- a/pdf2swf/xpdf/FoFiTrueType.h +++ /dev/null @@ -1,140 +0,0 @@ -//======================================================================== -// -// FoFiTrueType.h -// -// Copyright 1999-2003 Glyph & Cog, LLC -// -//======================================================================== - -#ifndef FOFITRUETYPE_H -#define FOFITRUETYPE_H - -#include - -#ifdef USE_GCC_PRAGMAS -#pragma interface -#endif - -#include "gtypes.h" -#include "FoFiBase.h" - -class GString; -class GHash; -struct TrueTypeTable; -struct TrueTypeCmap; - -//------------------------------------------------------------------------ -// FoFiTrueType -//------------------------------------------------------------------------ - -class FoFiTrueType: public FoFiBase { -public: - - // Create a FoFiTrueType object from a memory buffer. - static FoFiTrueType *make(char *fileA, int lenA); - - // Create a FoFiTrueType object from a file on disk. - static FoFiTrueType *load(char *fileName); - - virtual ~FoFiTrueType(); - - // Return the number of cmaps defined by this font. - int getNumCmaps(); - - // Return the platform ID of the th cmap. - int getCmapPlatform(int i); - - // Return the encoding ID of the th cmap. - int getCmapEncoding(int i); - - // Return the index of the cmap for , . Returns - // -1 if there is no corresponding cmap. - int findCmap(int platform, int encoding); - - // Return the GID corresponding to according to the th cmap. - Gushort mapCodeToGID(int i, int c); - - // Returns the GID corresponding to according to the post - // table. Returns 0 if there is no mapping for or if the - // font does not have a post table. - int mapNameToGID(char *name); - - // Returns the least restrictive embedding licensing right (as - // defined by the TrueType spec): - // * 4: OS/2 table is missing or invalid - // * 3: installable embedding - // * 2: editable embedding - // * 1: preview & print embedding - // * 0: restricted license embedding - int getEmbeddingRights(); - - // Convert to a Type 42 font, suitable for embedding in a PostScript - // file. will be used as the PostScript font name (so we - // don't need to depend on the 'name' table in the font). The - // array specifies the mapping from char codes to names. - // If is NULL, the encoding is unknown or undefined. The - // array specifies the mapping from char codes to GIDs. - void convertToType42(char *psName, char **encoding, - Gushort *codeToGID, - FoFiOutputFunc outputFunc, void *outputStream); - - // Convert to a Type 2 CIDFont, suitable for embedding in a - // PostScript file. will be used as the PostScript font - // name (so we don't need to depend on the 'name' table in the - // font). The array maps CIDs to GIDs; it has - // entries. - void convertToCIDType2(char *psName, Gushort *cidMap, int nCIDs, - GBool needVerticalMetrics, - FoFiOutputFunc outputFunc, void *outputStream); - - // Convert to a Type 0 (but non-CID) composite font, suitable for - // embedding in a PostScript file. will be used as the - // PostScript font name (so we don't need to depend on the 'name' - // table in the font). The array maps CIDs to GIDs; it has - // entries. - void convertToType0(char *psName, Gushort *cidMap, int nCIDs, - GBool needVerticalMetrics, - FoFiOutputFunc outputFunc, void *outputStream); - - // Write a clean TTF file, filling in missing tables and correcting - // various other errors. If is non-NULL, the font is renamed - // to . If is non-NULL, the font is re-encoded, - // using a Windows Unicode cmap. If is NULL and the font is - // complete and correct, it will be written unmodified. - void writeTTF(FoFiOutputFunc outputFunc, void *outputStream, - char *name = NULL, Gushort *codeToGID = NULL); - -private: - - FoFiTrueType(char *fileA, int lenA, GBool freeFileDataA); - void cvtEncoding(char **encoding, - FoFiOutputFunc outputFunc, - void *outputStream); - void cvtCharStrings(char **encoding, - Gushort *codeToGID, - FoFiOutputFunc outputFunc, - void *outputStream); - void cvtSfnts(FoFiOutputFunc outputFunc, - void *outputStream, GString *name, - GBool needVerticalMetrics); - void dumpString(Guchar *s, int length, - FoFiOutputFunc outputFunc, - void *outputStream); - Guint computeTableChecksum(Guchar *data, int length); - void parse(); - void readPostTable(); - int seekTable(char *tag); - - TrueTypeTable *tables; - int nTables; - TrueTypeCmap *cmaps; - int nCmaps; - int nGlyphs; - int locaFmt; - int bbox[4]; - GHash *nameToGID; - - GBool parsedOk; -}; - -#endif