From 768e5bb3ee822bd1db4da2859e51c9bb17281c8b Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Sun, 1 Oct 2017 18:18:42 +1030 Subject: [PATCH 07/11] Remove HAVE_FREETYPE macros Freetype is a mandatory dependency so we can drop the macros. --- CMakeLists.txt | 1 - config.h.cmake | 3 --- poppler/SplashOutputDev.cc | 8 -------- poppler/poppler-config.h.cmake | 7 +------ qt4/src/ArthurOutputDev.cc | 2 -- qt5/src/ArthurOutputDev.cc | 2 -- splash/SplashFTFont.cc | 4 ---- splash/SplashFTFont.h | 4 ---- splash/SplashFTFontEngine.cc | 4 ---- splash/SplashFTFontEngine.h | 4 ---- splash/SplashFTFontFile.cc | 4 ---- splash/SplashFTFontFile.h | 4 ---- splash/SplashFontEngine.cc | 20 -------------------- splash/SplashFontEngine.h | 6 ------ utils/pdftoppm.cc | 2 -- 15 files changed, 1 insertion(+), 74 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8837bf73..fa24ea95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -288,7 +288,6 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR}/poppler ${FREETYPE_INCLUDE_DIRS} ) -set(HAVE_FREETYPE_H ON) if(CMAKE_USE_PTHREADS_INIT) set(HAVE_PTHREAD ON) endif() diff --git a/config.h.cmake b/config.h.cmake index a8e1bbd7..bc410f19 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -46,9 +46,6 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_FCNTL_H 1 -/* Have FreeType2 include files */ -#cmakedefine HAVE_FREETYPE_H 1 - /* Define to 1 if you have the `fseek64' function. */ #cmakedefine HAVE_FSEEK64 1 diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc index 2fc61208..4315d4d4 100644 --- a/poppler/SplashOutputDev.cc +++ b/poppler/SplashOutputDev.cc @@ -1500,11 +1500,9 @@ void SplashOutputDev::startDoc(PDFDoc *docA) { delete fontEngine; } fontEngine = new SplashFontEngine( -#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H globalParams->getEnableFreeType(), enableFreeTypeHinting, enableSlightHinting, -#endif getFontAntialias() && colorMode != splashModeMono1); for (i = 0; i < nT3Fonts; ++i) { @@ -4267,9 +4265,7 @@ void SplashOutputDev::beginTransparencyGroup(GfxState *state, double *bbox, // save state transpGroup->origBitmap = bitmap; transpGroup->origSplash = splash; -#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H transpGroup->fontAA = fontEngine->getAA(); -#endif //~ this handles the blendingColorSpace arg for soft masks, but //~ not yet for transparency groups @@ -4307,9 +4303,7 @@ void SplashOutputDev::beginTransparencyGroup(GfxState *state, double *bbox, splash = new Splash(bitmap, vectorAntialias, transpGroup->origSplash->getScreen()); if (transpGroup->next != NULL && transpGroup->next->knockout) { -#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H fontEngine->setAA(gFalse); -#endif } splash->setThinLineMode(transpGroup->origSplash->getThinLineMode()); splash->setMinLineWidth(globalParams->getMinLineWidth()); @@ -4373,9 +4367,7 @@ void SplashOutputDev::paintTransparencyGroup(GfxState *state, double *bbox) { splash->composite(tBitmap, 0, 0, tx, ty, tBitmap->getWidth(), tBitmap->getHeight(), gFalse, !isolated, transpGroupStack->next != NULL && transpGroupStack->next->knockout, knockoutOpacity); -#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H fontEngine->setAA(transpGroupStack->fontAA); -#endif if (transpGroupStack->next != NULL && transpGroupStack->next->shape != NULL) { transpGroupStack->next->knockout = gTrue; } diff --git a/poppler/poppler-config.h.cmake b/poppler/poppler-config.h.cmake index 9bac2d76..ba6f5e32 100644 --- a/poppler/poppler-config.h.cmake +++ b/poppler/poppler-config.h.cmake @@ -115,11 +115,6 @@ #cmakedefine HAVE_SYS_NDIR_H 1 #endif -/* Have FreeType2 include files */ -#ifndef HAVE_FREETYPE_H -#cmakedefine HAVE_FREETYPE_H 1 -#endif - /* Defines if use cms */ #ifndef USE_CMS #cmakedefine USE_CMS 1 @@ -128,7 +123,7 @@ // Also, there are preprocessor symbols in the header files // that are used but never defined when building poppler using configure // or cmake: DISABLE_OUTLINE, DEBUG_MEM, -// ENABLE_PLUGINS, DEBUG_FORMS, HAVE_FREETYPE_FREETYPE_H +// ENABLE_PLUGINS, DEBUG_FORMS //------------------------------------------------------------------------ // version diff --git a/qt4/src/ArthurOutputDev.cc b/qt4/src/ArthurOutputDev.cc index 547198c8..8b5caeec 100644 --- a/qt4/src/ArthurOutputDev.cc +++ b/qt4/src/ArthurOutputDev.cc @@ -112,11 +112,9 @@ void ArthurOutputDev::startDoc(XRef *xrefA) { const bool isSlightHinting = m_fontHinting == SlightHinting; m_fontEngine = new SplashFontEngine( -#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H globalParams->getEnableFreeType(), isHintingEnabled, isSlightHinting, -#endif m_painter->testRenderHint(QPainter::TextAntialiasing)); #endif } diff --git a/qt5/src/ArthurOutputDev.cc b/qt5/src/ArthurOutputDev.cc index 5d43e4ab..08e81d41 100644 --- a/qt5/src/ArthurOutputDev.cc +++ b/qt5/src/ArthurOutputDev.cc @@ -111,11 +111,9 @@ void ArthurOutputDev::startDoc(XRef *xrefA) { const bool isSlightHinting = m_fontHinting == SlightHinting; m_fontEngine = new SplashFontEngine( -#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H globalParams->getEnableFreeType(), isHintingEnabled, isSlightHinting, -#endif m_painter->testRenderHint(QPainter::TextAntialiasing)); #endif } diff --git a/splash/SplashFTFont.cc b/splash/SplashFTFont.cc index 38911d3b..268f50e6 100644 --- a/splash/SplashFTFont.cc +++ b/splash/SplashFTFont.cc @@ -25,8 +25,6 @@ #include -#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H - #ifdef USE_GCC_PRAGMAS #pragma implementation #endif @@ -509,5 +507,3 @@ static int glyphPathCubicTo(const FT_Vector *ctrl1, const FT_Vector *ctrl2, p->needClose = gTrue; return 0; } - -#endif // HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H diff --git a/splash/SplashFTFont.h b/splash/SplashFTFont.h index 7d5c1e32..f354210a 100644 --- a/splash/SplashFTFont.h +++ b/splash/SplashFTFont.h @@ -25,8 +25,6 @@ #include "poppler-config.h" -#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H - #ifdef USE_GCC_PRAGMAS #pragma interface #endif @@ -75,6 +73,4 @@ private: GBool enableSlightHinting; }; -#endif // HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H - #endif diff --git a/splash/SplashFTFontEngine.cc b/splash/SplashFTFontEngine.cc index 9fef8f00..eb1d8cf1 100644 --- a/splash/SplashFTFontEngine.cc +++ b/splash/SplashFTFontEngine.cc @@ -23,8 +23,6 @@ #include -#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H - #ifdef USE_GCC_PRAGMAS #pragma implementation #endif @@ -176,5 +174,3 @@ SplashFontFile *SplashFTFontEngine::loadTrueTypeFont(SplashFontFileID *idA, faceIndex); return ret; } - -#endif // HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H diff --git a/splash/SplashFTFontEngine.h b/splash/SplashFTFontEngine.h index 11bbea74..37835bcb 100644 --- a/splash/SplashFTFontEngine.h +++ b/splash/SplashFTFontEngine.h @@ -25,8 +25,6 @@ #ifndef SPLASHFTFONTENGINE_H #define SPLASHFTFONTENGINE_H -#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H - #ifdef USE_GCC_PRAGMAS #pragma interface #endif @@ -76,6 +74,4 @@ private: friend class SplashFTFont; }; -#endif // HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H - #endif diff --git a/splash/SplashFTFontFile.cc b/splash/SplashFTFontFile.cc index 5c4f24d3..6058067a 100644 --- a/splash/SplashFTFontFile.cc +++ b/splash/SplashFTFontFile.cc @@ -21,8 +21,6 @@ #include -#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H - #ifdef USE_GCC_PRAGMAS #pragma implementation #endif @@ -148,5 +146,3 @@ SplashFont *SplashFTFontFile::makeFont(SplashCoord *mat, int *SplashFTFontFile::getCodeToGID() { return codeToGID; } - -#endif // HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H diff --git a/splash/SplashFTFontFile.h b/splash/SplashFTFontFile.h index 25303ccc..6d11a4f5 100644 --- a/splash/SplashFTFontFile.h +++ b/splash/SplashFTFontFile.h @@ -21,8 +21,6 @@ #ifndef SPLASHFTFONTFILE_H #define SPLASHFTFONTFILE_H -#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H - #ifdef USE_GCC_PRAGMAS #pragma interface #endif @@ -84,6 +82,4 @@ private: friend class SplashFTFont; }; -#endif // HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H - #endif diff --git a/splash/SplashFontEngine.cc b/splash/SplashFontEngine.cc index 462eb3da..d8dd3e2f 100644 --- a/splash/SplashFontEngine.cc +++ b/splash/SplashFontEngine.cc @@ -61,11 +61,9 @@ extern "C" int unlink(char *filename); //------------------------------------------------------------------------ SplashFontEngine::SplashFontEngine( -#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H GBool enableFreeType, GBool enableFreeTypeHinting, GBool enableSlightHinting, -#endif GBool aa) { int i; @@ -73,13 +71,11 @@ SplashFontEngine::SplashFontEngine( fontCache[i] = NULL; } -#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H if (enableFreeType) { ftEngine = SplashFTFontEngine::init(aa, enableFreeTypeHinting, enableSlightHinting); } else { ftEngine = NULL; } -#endif } SplashFontEngine::~SplashFontEngine() { @@ -91,11 +87,9 @@ SplashFontEngine::~SplashFontEngine() { } } -#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H if (ftEngine) { delete ftEngine; } -#endif } SplashFontFile *SplashFontEngine::getFontFile(SplashFontFileID *id) { @@ -119,11 +113,9 @@ SplashFontFile *SplashFontEngine::loadType1Font(SplashFontFileID *idA, SplashFontFile *fontFile; fontFile = NULL; -#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H if (!fontFile && ftEngine) { fontFile = ftEngine->loadType1Font(idA, src, enc); } -#endif // delete the (temporary) font file -- with Unix hard link // semantics, this will remove the last link; otherwise it will @@ -141,11 +133,9 @@ SplashFontFile *SplashFontEngine::loadType1CFont(SplashFontFileID *idA, SplashFontFile *fontFile; fontFile = NULL; -#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H if (!fontFile && ftEngine) { fontFile = ftEngine->loadType1CFont(idA, src, enc); } -#endif // delete the (temporary) font file -- with Unix hard link // semantics, this will remove the last link; otherwise it will @@ -163,11 +153,9 @@ SplashFontFile *SplashFontEngine::loadOpenTypeT1CFont(SplashFontFileID *idA, SplashFontFile *fontFile; fontFile = NULL; -#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H if (!fontFile && ftEngine) { fontFile = ftEngine->loadOpenTypeT1CFont(idA, src, enc); } -#endif // delete the (temporary) font file -- with Unix hard link // semantics, this will remove the last link; otherwise it will @@ -184,11 +172,9 @@ SplashFontFile *SplashFontEngine::loadCIDFont(SplashFontFileID *idA, SplashFontFile *fontFile; fontFile = NULL; -#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H if (!fontFile && ftEngine) { fontFile = ftEngine->loadCIDFont(idA, src); } -#endif // delete the (temporary) font file -- with Unix hard link // semantics, this will remove the last link; otherwise it will @@ -207,11 +193,9 @@ SplashFontFile *SplashFontEngine::loadOpenTypeCFFFont(SplashFontFileID *idA, SplashFontFile *fontFile; fontFile = NULL; -#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H if (!fontFile && ftEngine) { fontFile = ftEngine->loadOpenTypeCFFFont(idA, src, codeToGID, codeToGIDLen); } -#endif // delete the (temporary) font file -- with Unix hard link // semantics, this will remove the last link; otherwise it will @@ -231,12 +215,10 @@ SplashFontFile *SplashFontEngine::loadTrueTypeFont(SplashFontFileID *idA, SplashFontFile *fontFile; fontFile = NULL; -#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H if (!fontFile && ftEngine) { fontFile = ftEngine->loadTrueTypeFont(idA, src, codeToGID, codeToGIDLen, faceIndex); } -#endif if (!fontFile) { gfree(codeToGID); @@ -252,7 +234,6 @@ SplashFontFile *SplashFontEngine::loadTrueTypeFont(SplashFontFileID *idA, return fontFile; } -#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H GBool SplashFontEngine::getAA() { return (ftEngine == NULL) ? gFalse : ftEngine->getAA(); } @@ -262,7 +243,6 @@ void SplashFontEngine::setAA(GBool aa) { ftEngine->setAA(aa); } } -#endif SplashFont *SplashFontEngine::getFont(SplashFontFile *fontFile, SplashCoord *textMat, diff --git a/splash/SplashFontEngine.h b/splash/SplashFontEngine.h index 6afa3908..9f0ae0e6 100644 --- a/splash/SplashFontEngine.h +++ b/splash/SplashFontEngine.h @@ -54,11 +54,9 @@ public: // Create a font engine. SplashFontEngine( -#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H GBool enableFreeType, GBool enableFreeTypeHinting, GBool enableSlightHinting, -#endif GBool aa); ~SplashFontEngine(); @@ -87,18 +85,14 @@ public: // Note that the Splash y axis points downward. SplashFont *getFont(SplashFontFile *fontFile, SplashCoord *textMat, SplashCoord *ctm); -#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H GBool getAA(); void setAA(GBool aa); -#endif private: SplashFont *fontCache[splashFontCacheSize]; -#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H SplashFTFontEngine *ftEngine; -#endif }; #endif diff --git a/utils/pdftoppm.cc b/utils/pdftoppm.cc index e320525c..136d6894 100644 --- a/utils/pdftoppm.cc +++ b/utils/pdftoppm.cc @@ -176,10 +176,8 @@ static const ArgDesc argDesc[] = { {"-tiffcompression", argString, TiffCompressionStr, sizeof(TiffCompressionStr), "set TIFF compression: none, packbits, jpeg, lzw, deflate"}, #endif -#if HAVE_FREETYPE_FREETYPE_H | HAVE_FREETYPE_H {"-freetype", argString, enableFreeTypeStr, sizeof(enableFreeTypeStr), "enable FreeType font rasterizer: yes, no"}, -#endif {"-thinlinemode", argString, thinLineModeStr, sizeof(thinLineModeStr), "set thin line mode: none, solid, shape. Default: none"}, -- 2.11.0