From a9317c7e44857d4d07adfaa55ee9ef264ed0779d Mon Sep 17 00:00:00 2001 From: Thomas Weidner Date: Thu, 30 Jul 2015 15:51:49 +0200 Subject: [PATCH] Disable stem darkening for cff FT engine stem darkening requires proper gamma correction and is only implemented for the cff engine this causes weird results when font formats are mixed within a single pdf --- splash/SplashFTFontEngine.cc | 7 +++++++ splash/SplashFTFontEngine.h | 1 + 2 files changed, 8 insertions(+) diff --git a/splash/SplashFTFontEngine.cc b/splash/SplashFTFontEngine.cc index 9fef8f0..b255716 100644 --- a/splash/SplashFTFontEngine.cc +++ b/splash/SplashFTFontEngine.cc @@ -69,10 +69,17 @@ SplashFTFontEngine::SplashFTFontEngine(GBool aaA, GBool enableFreeTypeHintingA, SplashFTFontEngine *SplashFTFontEngine::init(GBool aaA, GBool enableFreeTypeHintingA, GBool enableSlightHintingA) { FT_Library libA; + FT_Bool no_stem_darkening; if (FT_Init_FreeType(&libA)) { return NULL; } + + // Stem darkening is only implemented for the cff engine (as of FT 2.6) + // and requires proper gamma correction, which is not yet in poppler + no_stem_darkening = 1; + FT_Property_Set(libA, "cff", "no-stem-darkening", &no_stem_darkening); + return new SplashFTFontEngine(aaA, enableFreeTypeHintingA, enableSlightHintingA, libA); } diff --git a/splash/SplashFTFontEngine.h b/splash/SplashFTFontEngine.h index 11bbea7..7f1f8cd 100644 --- a/splash/SplashFTFontEngine.h +++ b/splash/SplashFTFontEngine.h @@ -33,6 +33,7 @@ #include #include FT_FREETYPE_H +#include FT_MODULE_H #include "goo/gtypes.h" class SplashFontFile; -- 2.5.0