diff options
author | Kristian Høgsberg <krh@redhat.com> | 2005-03-01 22:24:10 (GMT) |
---|---|---|
committer | Kristian Høgsberg <krh@src.gnome.org> | 2005-03-01 22:24:10 (GMT) |
commit | 02eb16fef45712a91e24f6471b9e2f31249c888e (patch) | |
tree | d5579258f1d7fbd5a280fb2f1b97b74004b1dea9 /pdf/splash/SplashFTFontEngine.cc | |
parent | 332afee84ff4eb7df326d96f07efd6f82a87c0a2 (diff) |
Use poppler instead of including xpdf source code. Poppler is a fork of
2005-03-01 Kristian Høgsberg <krh@redhat.com>
Use poppler instead of including xpdf source code. Poppler is a
fork of xpdf to build it as a shared library. See
http://freedesktop.org/wiki/Software/poppler.
* pdf/xpdf/*, pdf/goo/*, pdf/splash/*, pdf/fofi/*: Remove included
xpdf fork.
* pdf/Makefile.am: Build libpdfdocument.a here.
* pdf/GDKSplashOutputDev.cc:
* pdf/GDKSplashOutputDev.h:
* pdf/GnomeVFSStream.cc:
* pdf/GnomeVFSStream.h:
* pdf-document.cc:
* pdf-document.h:
* test-gdk-output-dev.cc
* Thumb.cc:
* Thumb.h: Pull these files out of pdf/xpdf and adjust to compile
against poppler.
Diffstat (limited to 'pdf/splash/SplashFTFontEngine.cc')
-rw-r--r-- | pdf/splash/SplashFTFontEngine.cc | 141 |
1 files changed, 0 insertions, 141 deletions
diff --git a/pdf/splash/SplashFTFontEngine.cc b/pdf/splash/SplashFTFontEngine.cc deleted file mode 100644 index 7401459..0000000 --- a/pdf/splash/SplashFTFontEngine.cc +++ /dev/null @@ -1,141 +0,0 @@ -//======================================================================== -// -// SplashFTFontEngine.cc -// -//======================================================================== - -#include <aconf.h> - -#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H - -#ifdef USE_GCC_PRAGMAS -#pragma implementation -#endif - -#include <stdio.h> -#ifndef WIN32 -# include <unistd.h> -#endif -#include "gmem.h" -#include "GString.h" -#include "gfile.h" -#include "FoFiTrueType.h" -#include "FoFiType1C.h" -#include "SplashFTFontFile.h" -#include "SplashFTFontEngine.h" - -#ifdef VMS -#if (__VMS_VER < 70000000) -extern "C" int unlink(char *filename); -#endif -#endif - -//------------------------------------------------------------------------ - -static void fileWrite(void *stream, char *data, int len) { - fwrite(data, 1, len, (FILE *)stream); -} - -//------------------------------------------------------------------------ -// SplashFTFontEngine -//------------------------------------------------------------------------ - -SplashFTFontEngine::SplashFTFontEngine(GBool aaA, FT_Library libA) { - aa = aaA; - lib = libA; -} - -SplashFTFontEngine *SplashFTFontEngine::init(GBool aaA) { - FT_Library libA; - - if (FT_Init_FreeType(&libA)) { - return NULL; - } - return new SplashFTFontEngine(aaA, libA); -} - -SplashFTFontEngine::~SplashFTFontEngine() { - FT_Done_FreeType(lib); -} - -SplashFontFile *SplashFTFontEngine::loadType1Font(SplashFontFileID *idA, - char *fileName, - GBool deleteFile, - char **enc) { - return SplashFTFontFile::loadType1Font(this, idA, fileName, deleteFile, enc); -} - -SplashFontFile *SplashFTFontEngine::loadType1CFont(SplashFontFileID *idA, - char *fileName, - GBool deleteFile, - char **enc) { - return SplashFTFontFile::loadType1Font(this, idA, fileName, deleteFile, enc); -} - -SplashFontFile *SplashFTFontEngine::loadCIDFont(SplashFontFileID *idA, - char *fileName, - GBool deleteFile) { - FoFiType1C *ff; - Gushort *cidToGIDMap; - int nCIDs; - SplashFontFile *ret; - - // check for a CFF font -#if HAVE_FREETYPE_217_OR_OLDER - if ((ff = FoFiType1C::load(fileName))) { - cidToGIDMap = ff->getCIDToGIDMap(&nCIDs); - delete ff; - } else { - cidToGIDMap = NULL; - nCIDs = 0; - } -#else - // No need to check for CFF Font, freetype treats all CID fonts the same way - cidToGIDMap = NULL; - nCIDs = 0; -#endif - - ret = SplashFTFontFile::loadCIDFont(this, idA, fileName, deleteFile, - cidToGIDMap, nCIDs); - if (!ret) { - gfree(cidToGIDMap); - } - return ret; -} - -SplashFontFile *SplashFTFontEngine::loadTrueTypeFont(SplashFontFileID *idA, - char *fileName, - GBool deleteFile, - Gushort *codeToGID, - int codeToGIDLen) { - FoFiTrueType *ff; - GString *tmpFileName; - FILE *tmpFile; - SplashFontFile *ret; - - if (!(ff = FoFiTrueType::load(fileName))) { - return NULL; - } - tmpFileName = NULL; - if (!openTempFile(&tmpFileName, &tmpFile, "wb", NULL)) { - delete ff; - return NULL; - } - ff->writeTTF(&fileWrite, tmpFile); - delete ff; - fclose(tmpFile); - ret = SplashFTFontFile::loadTrueTypeFont(this, idA, - tmpFileName->getCString(), - gTrue, codeToGID, codeToGIDLen); - if (ret) { - if (deleteFile) { - unlink(fileName); - } - } else { - unlink(tmpFileName->getCString()); - } - delete tmpFileName; - return ret; -} - -#endif // HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H |