[poppler] Branch 'xpdf303merge' - poppler/ArthurOutputDev.cc poppler/GlobalParams.cc poppler/GlobalParams.h poppler/SplashOutputDev.cc poppler/SplashOutputDev.h splash/SplashFontEngine.cc splash/SplashFontEngine.h splash/SplashFTFont.cc splash/SplashFTFontEngine.cc splash/SplashFTFontEngine.h splash/SplashFTFont.h utils/pdftoppm.cc
Albert Astals Cid
aacid at kemper.freedesktop.org
Mon Feb 6 10:55:32 PST 2012
poppler/ArthurOutputDev.cc | 1 -
poppler/GlobalParams.cc | 10 ----------
poppler/GlobalParams.h | 1 -
poppler/SplashOutputDev.cc | 3 ---
poppler/SplashOutputDev.h | 1 -
splash/SplashFTFont.cc | 40 +++++++++++++++++++---------------------
splash/SplashFTFont.h | 1 -
splash/SplashFTFontEngine.cc | 7 +++----
splash/SplashFTFontEngine.h | 5 ++---
splash/SplashFontEngine.cc | 3 +--
splash/SplashFontEngine.h | 1 -
utils/pdftoppm.cc | 2 +-
12 files changed, 26 insertions(+), 49 deletions(-)
New commits:
commit b8c9b179c9491cf6755b07bfdec4174e78b7d241
Author: Albert Astals Cid <aacid at kde.org>
Date: Mon Feb 6 19:55:07 2012 +0100
[xpdf303] Adapt better to what we did and what xpdf303 does
diff --git a/poppler/ArthurOutputDev.cc b/poppler/ArthurOutputDev.cc
index 301232b..d373d0b 100644
--- a/poppler/ArthurOutputDev.cc
+++ b/poppler/ArthurOutputDev.cc
@@ -116,7 +116,6 @@ void ArthurOutputDev::startDoc(XRef *xrefA) {
#endif
#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
globalParams->getEnableFreeType(),
- !globalParams->getDisableFreeTypeHinting(),
isHintingEnabled,
isSlightHinting,
#endif
diff --git a/poppler/GlobalParams.cc b/poppler/GlobalParams.cc
index e7cbce5..72448bf 100644
--- a/poppler/GlobalParams.cc
+++ b/poppler/GlobalParams.cc
@@ -597,7 +597,6 @@ GlobalParams::GlobalParams(const char *customPopplerDataDir)
textPageBreaks = gTrue;
textKeepTinyChars = gFalse;
enableFreeType = gTrue;
- disableFreeTypeHinting = gFalse;
antialias = gTrue;
vectorAntialias = gTrue;
antialiasPrinting = gFalse;
@@ -1667,15 +1666,6 @@ GBool GlobalParams::getEnableFreeType() {
return f;
}
-GBool GlobalParams::getDisableFreeTypeHinting() {
- GBool f;
-
- lockGlobalParams;
- f = disableFreeTypeHinting;
- unlockGlobalParams;
- return f;
-}
-
GBool GlobalParams::getAntialias() {
GBool f;
diff --git a/poppler/GlobalParams.h b/poppler/GlobalParams.h
index b268d71..7e23cff 100644
--- a/poppler/GlobalParams.h
+++ b/poppler/GlobalParams.h
@@ -174,7 +174,6 @@ public:
GBool getTextPageBreaks();
GBool getTextKeepTinyChars();
GBool getEnableFreeType();
- GBool getDisableFreeTypeHinting();
GBool getAntialias();
GBool getVectorAntialias();
GBool getAntialiasPrinting();
diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc
index 825c7ad..69e26a0 100644
--- a/poppler/SplashOutputDev.cc
+++ b/poppler/SplashOutputDev.cc
@@ -1162,7 +1162,6 @@ SplashOutputDev::SplashOutputDev(SplashColorMode colorModeA,
vectorAntialias = allowAntialias &&
globalParams->getVectorAntialias() &&
colorMode != splashModeMono1;
- enableAutoHinting = !globalParams->getDisableFreeTypeHinting();
enableFreeTypeHinting = gFalse;
enableSlightHinting = gFalse;
setupScreenParams(72.0, 72.0);
@@ -1277,7 +1276,6 @@ void SplashOutputDev::startDoc(PDFDoc *docA) {
#endif
#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
globalParams->getEnableFreeType(),
- enableAutoHinting,
enableFreeTypeHinting,
enableSlightHinting,
#endif
@@ -3837,7 +3835,6 @@ void SplashOutputDev::setVectorAntialias(GBool vaa) {
void SplashOutputDev::setFreeTypeHinting(GBool enable, GBool enableSlightHintingA)
{
- enableAutoHinting = gFalse;
enableFreeTypeHinting = enable;
enableSlightHinting = enableSlightHintingA;
}
diff --git a/poppler/SplashOutputDev.h b/poppler/SplashOutputDev.h
index c190203..230e751 100644
--- a/poppler/SplashOutputDev.h
+++ b/poppler/SplashOutputDev.h
@@ -383,7 +383,6 @@ private:
GBool bitmapUpsideDown;
GBool allowAntialias;
GBool vectorAntialias;
- GBool enableAutoHinting;
GBool enableFreeTypeHinting;
GBool enableSlightHinting;
GBool reverseVideo; // reverse video mode
diff --git a/splash/SplashFTFont.cc b/splash/SplashFTFont.cc
index b511c96..f18b58b 100644
--- a/splash/SplashFTFont.cc
+++ b/splash/SplashFTFont.cc
@@ -58,7 +58,6 @@ static int glyphPathCubicTo(const FT_Vector *ctrl1, const FT_Vector *ctrl2,
SplashFTFont::SplashFTFont(SplashFTFontFile *fontFileA, SplashCoord *matA,
SplashCoord *textMatA):
SplashFont(fontFileA, matA, textMatA, fontFileA->engine->aa),
- enableAutoHinting(fontFileA->engine->enableAutoHinting),
enableFreeTypeHinting(fontFileA->engine->enableFreeTypeHinting),
enableSlightHinting(fontFileA->engine->enableSlightHinting)
{
@@ -233,30 +232,29 @@ GBool SplashFTFont::getGlyph(int c, int xFrac, int yFrac,
return SplashFont::getGlyph(c, xFrac, 0, bitmap, x0, y0, clip, clipRes);
}
-static FT_Int32 getFTLoadFlags(GBool type1, GBool trueType, GBool aa,
- GBool enableAutoHinting, GBool enableFreeTypeHinting, GBool enableSlightHinting)
+static FT_Int32 getFTLoadFlags(GBool type1, GBool trueType, GBool aa, GBool enableFreeTypeHinting, GBool enableSlightHinting)
{
int ret = FT_LOAD_DEFAULT;
if (aa)
ret |= FT_LOAD_NO_BITMAP;
- if (enableAutoHinting) {
- if (trueType) {
- // FT2's autohinting doesn't always work very well (especially with
- // font subsets), so turn it off if anti-aliasing is enabled; if
- // anti-aliasing is disabled, this seems to be a tossup - some fonts
- // look better with hinting, some without, so leave hinting on
- if (aa) {
- ret |= FT_LOAD_NO_AUTOHINT;
- }
- } else if (type1) {
- // Type 1 fonts seem to look better with 'light' hinting mode
+ if (enableFreeTypeHinting) {
+ if (enableSlightHinting) {
ret |= FT_LOAD_TARGET_LIGHT;
+ } else {
+ if (trueType) {
+ // FT2's autohinting doesn't always work very well (especially with
+ // font subsets), so turn it off if anti-aliasing is enabled; if
+ // anti-aliasing is disabled, this seems to be a tossup - some fonts
+ // look better with hinting, some without, so leave hinting on
+ if (aa) {
+ ret |= FT_LOAD_NO_AUTOHINT;
+ }
+ } else if (type1) {
+ // Type 1 fonts seem to look better with 'light' hinting mode
+ ret |= FT_LOAD_TARGET_LIGHT;
+ }
}
-
- } else if (enableFreeTypeHinting) {
- if (enableSlightHinting)
- ret |= FT_LOAD_TARGET_LIGHT;
} else {
ret |= FT_LOAD_NO_HINTING;
}
@@ -287,7 +285,7 @@ GBool SplashFTFont::makeGlyph(int c, int xFrac, int yFrac,
gid = (FT_UInt)c;
}
- if (FT_Load_Glyph(ff->face, gid, getFTLoadFlags(ff->type1, ff->trueType, aa, enableAutoHinting, enableFreeTypeHinting, enableSlightHinting))) {
+ if (FT_Load_Glyph(ff->face, gid, getFTLoadFlags(ff->type1, ff->trueType, aa, enableFreeTypeHinting, enableSlightHinting))) {
return gFalse;
}
@@ -376,7 +374,7 @@ double SplashFTFont::getGlyphAdvance(int c)
return -1;
}
- if (FT_Load_Glyph(ff->face, gid, getFTLoadFlags(ff->type1, ff->trueType, aa, enableAutoHinting, enableFreeTypeHinting, enableSlightHinting))) {
+ if (FT_Load_Glyph(ff->face, gid, getFTLoadFlags(ff->type1, ff->trueType, aa, enableFreeTypeHinting, enableSlightHinting))) {
return -1;
}
@@ -424,7 +422,7 @@ SplashPath *SplashFTFont::getGlyphPath(int c) {
// skip the TrueType notdef glyph
return NULL;
}
- if (FT_Load_Glyph(ff->face, gid, getFTLoadFlags(ff->type1, ff->trueType, aa, enableAutoHinting, enableFreeTypeHinting, enableSlightHinting))) {
+ if (FT_Load_Glyph(ff->face, gid, getFTLoadFlags(ff->type1, ff->trueType, aa, enableFreeTypeHinting, enableSlightHinting))) {
return NULL;
}
if (FT_Get_Glyph(slot, &glyph)) {
diff --git a/splash/SplashFTFont.h b/splash/SplashFTFont.h
index 1745807..f49d7b1 100644
--- a/splash/SplashFTFont.h
+++ b/splash/SplashFTFont.h
@@ -71,7 +71,6 @@ private:
FT_Matrix textMatrix;
SplashCoord textScale;
int size;
- GBool enableAutoHinting;
GBool enableFreeTypeHinting;
GBool enableSlightHinting;
};
diff --git a/splash/SplashFTFontEngine.cc b/splash/SplashFTFontEngine.cc
index dee5728..7a4568d 100644
--- a/splash/SplashFTFontEngine.cc
+++ b/splash/SplashFTFontEngine.cc
@@ -59,12 +59,11 @@ static void fileWrite(void *stream, const char *data, int len) {
// SplashFTFontEngine
//------------------------------------------------------------------------
-SplashFTFontEngine::SplashFTFontEngine(GBool aaA, GBool enableAutoHintingA, GBool enableFreeTypeHintingA,
+SplashFTFontEngine::SplashFTFontEngine(GBool aaA, GBool enableFreeTypeHintingA,
GBool enableSlightHintingA, FT_Library libA) {
FT_Int major, minor, patch;
aa = aaA;
- enableAutoHinting = enableAutoHintingA;
enableFreeTypeHinting = enableFreeTypeHintingA;
enableSlightHinting = enableSlightHintingA;
lib = libA;
@@ -75,14 +74,14 @@ SplashFTFontEngine::SplashFTFontEngine(GBool aaA, GBool enableAutoHintingA, GBoo
(major == 2 && (minor > 1 || (minor == 1 && patch > 7)));
}
-SplashFTFontEngine *SplashFTFontEngine::init(GBool aaA, GBool enableAutoHintingA, GBool enableFreeTypeHintingA,
+SplashFTFontEngine *SplashFTFontEngine::init(GBool aaA, GBool enableFreeTypeHintingA,
GBool enableSlightHintingA) {
FT_Library libA;
if (FT_Init_FreeType(&libA)) {
return NULL;
}
- return new SplashFTFontEngine(aaA, enableAutoHintingA, enableFreeTypeHintingA, enableSlightHintingA, libA);
+ return new SplashFTFontEngine(aaA, enableFreeTypeHintingA, enableSlightHintingA, libA);
}
SplashFTFontEngine::~SplashFTFontEngine() {
diff --git a/splash/SplashFTFontEngine.h b/splash/SplashFTFontEngine.h
index d236e4f..aa1ad5f 100644
--- a/splash/SplashFTFontEngine.h
+++ b/splash/SplashFTFontEngine.h
@@ -45,7 +45,7 @@ class SplashFontSrc;
class SplashFTFontEngine {
public:
- static SplashFTFontEngine *init(GBool aaA, GBool enableAutoHintingA, GBool enableFreeTypeHintingA, GBool enableSlightHinting);
+ static SplashFTFontEngine *init(GBool aaA, GBool enableFreeTypeHintingA, GBool enableSlightHinting);
~SplashFTFontEngine();
@@ -61,10 +61,9 @@ public:
private:
- SplashFTFontEngine(GBool aaA, GBool enableAutoHintingA, GBool enableFreeTypeHintingA, GBool enableSlightHintingA, FT_Library libA);
+ SplashFTFontEngine(GBool aaA, GBool enableFreeTypeHintingA, GBool enableSlightHintingA, FT_Library libA);
GBool aa;
- GBool enableAutoHinting;
GBool enableFreeTypeHinting;
GBool enableSlightHinting;
FT_Library lib;
diff --git a/splash/SplashFontEngine.cc b/splash/SplashFontEngine.cc
index ab9beb9..2e74f5a 100644
--- a/splash/SplashFontEngine.cc
+++ b/splash/SplashFontEngine.cc
@@ -69,7 +69,6 @@ SplashFontEngine::SplashFontEngine(
#endif
#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
GBool enableFreeType,
- GBool enableAutoHinting,
GBool enableFreeTypeHinting,
GBool enableSlightHinting,
#endif
@@ -89,7 +88,7 @@ SplashFontEngine::SplashFontEngine(
#endif
#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
if (enableFreeType) {
- ftEngine = SplashFTFontEngine::init(aa, enableAutoHinting, enableFreeTypeHinting, enableSlightHinting);
+ ftEngine = SplashFTFontEngine::init(aa, enableFreeTypeHinting, enableSlightHinting);
} else {
ftEngine = NULL;
}
diff --git a/splash/SplashFontEngine.h b/splash/SplashFontEngine.h
index f0340a5..54926b4 100644
--- a/splash/SplashFontEngine.h
+++ b/splash/SplashFontEngine.h
@@ -58,7 +58,6 @@ public:
#endif
#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
GBool enableFreeType,
- GBool enabbleAutoHinting,
GBool enableFreeTypeHinting,
GBool enableSlightHinting,
#endif
diff --git a/utils/pdftoppm.cc b/utils/pdftoppm.cc
index 222c89b..a02da29 100644
--- a/utils/pdftoppm.cc
+++ b/utils/pdftoppm.cc
@@ -369,7 +369,7 @@ int main(int argc, char *argv[]) {
#if SPLASH_CMYK
(jpegcmyk || overprint) ? splashModeCMYK8 :
#endif
- splashModeRGB8, 4,
+ splashModeBGR8, 4,
gFalse, paperColor);
splashOut->startDoc(doc);
if (sz != 0) w = h = sz;
More information about the poppler
mailing list