From: Marco Pesenti Gritti Date: Wed, 26 Jan 2005 15:19:40 +0000 (+0000) Subject: Fix CID fonts with freetype 2.1.9 X-Git-Tag: EVINCE_0_1_3~35 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=5bde54f8810020217366ec3e9a64b44b4f6ee3c6;p=evince.git Fix CID fonts with freetype 2.1.9 2005-01-26 Marco Pesenti Gritti * configure.ac: * pdf/splash/SplashFTFontEngine.cc: Fix CID fonts with freetype 2.1.9 --- diff --git a/ChangeLog b/ChangeLog index 33f83253..7ee759cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-01-26 Marco Pesenti Gritti + + * configure.ac: + * pdf/splash/SplashFTFontEngine.cc: + + Fix CID fonts with freetype 2.1.9 + 2005-01-26 Bryan Clark * TODO: added item for desktop icon thumbnailer diff --git a/configure.ac b/configure.ac index ace97ff8..2a04fd88 100644 --- a/configure.ac +++ b/configure.ac @@ -267,6 +267,14 @@ if test "x$FREETYPE_CONFIG" != "xno" ; then FREETYPE_CFLAGS=`$FREETYPE_CONFIG --cflags` FREETYPE_LIBS=`$FREETYPE_CONFIG --libs` AC_DEFINE(HAVE_FREETYPE_H, 1, [Have FreeType2 include files]) + + vers=`$FREETYPE_CONFIG --version 2>/dev/null | sed -e 's/libfreetype //' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` + if test -n "$vers" && test "$vers" -le 9005003; then + AC_DEFINE_UNQUOTED(HAVE_FREETYPE_217_OR_OLDER, 1, [Defines if your system has the freetype library 2.1.7 or older]) + else + AC_DEFINE_UNQUOTED(HAVE_FREETYPE_217_OR_OLDER, 0, [Defines if your system has the freetype library 2.1.7 or older]) + fi + fi AC_SUBST(FREETYPE_CFLAGS) diff --git a/pdf/splash/SplashFTFontEngine.cc b/pdf/splash/SplashFTFontEngine.cc index 64dbc750..7401459a 100644 --- a/pdf/splash/SplashFTFontEngine.cc +++ b/pdf/splash/SplashFTFontEngine.cc @@ -81,6 +81,7 @@ SplashFontFile *SplashFTFontEngine::loadCIDFont(SplashFontFileID *idA, SplashFontFile *ret; // check for a CFF font +#if HAVE_FREETYPE_217_OR_OLDER if ((ff = FoFiType1C::load(fileName))) { cidToGIDMap = ff->getCIDToGIDMap(&nCIDs); delete ff; @@ -88,6 +89,12 @@ SplashFontFile *SplashFTFontEngine::loadCIDFont(SplashFontFileID *idA, 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) {