[poppler] poppler/GlobalParams.cc poppler/GlobalParams.h poppler/SplashOutputDev.cc poppler/SplashOutputDev.h qt5/src utils/pdftoppm.cc
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Nov 28 18:12:43 UTC 2019
poppler/GlobalParams.cc | 11 -----------
poppler/GlobalParams.h | 3 ---
poppler/SplashOutputDev.cc | 3 ++-
poppler/SplashOutputDev.h | 2 ++
qt5/src/ArthurOutputDev.cc | 4 ----
utils/pdftoppm.cc | 5 ++++-
6 files changed, 8 insertions(+), 20 deletions(-)
New commits:
commit 1496a00af0cb5f4c39d255493501957ef6a7f7da
Author: Albert Astals Cid <aacid at kde.org>
Date: Thu Nov 28 15:59:57 2019 +0100
Move enableFreeType out of GlobalParams
It's now moved to pdftoppm+SplashOutputDev that were the only users
diff --git a/poppler/GlobalParams.cc b/poppler/GlobalParams.cc
index 187a308a..3a081398 100644
--- a/poppler/GlobalParams.cc
+++ b/poppler/GlobalParams.cc
@@ -410,7 +410,6 @@ GlobalParams::GlobalParams(const char *customPopplerDataDir)
textEOL = eolUnix;
#endif
textPageBreaks = true;
- enableFreeType = true;
overprintPreview = false;
printCommands = false;
profileCommands = false;
@@ -1149,11 +1148,6 @@ bool GlobalParams::getTextPageBreaks() {
return textPageBreaks;
}
-bool GlobalParams::getEnableFreeType() {
- globalParamsLocker();
- return enableFreeType;
-}
-
bool GlobalParams::getPrintCommands() {
globalParamsLocker();
return printCommands;
@@ -1271,11 +1265,6 @@ void GlobalParams::setTextPageBreaks(bool pageBreaks) {
textPageBreaks = pageBreaks;
}
-bool GlobalParams::setEnableFreeType(const char *s) {
- globalParamsLocker();
- return parseYesNo2(s, &enableFreeType);
-}
-
void GlobalParams::setOverprintPreview(bool overprintPreviewA) {
globalParamsLocker();
overprintPreview = overprintPreviewA;
diff --git a/poppler/GlobalParams.h b/poppler/GlobalParams.h
index 1867fc06..fb65095a 100644
--- a/poppler/GlobalParams.h
+++ b/poppler/GlobalParams.h
@@ -136,7 +136,6 @@ public:
std::string getTextEncodingName() const;
EndOfLineKind getTextEOL();
bool getTextPageBreaks();
- bool getEnableFreeType();
bool getOverprintPreview() { return overprintPreview; }
bool getPrintCommands();
bool getProfileCommands();
@@ -157,7 +156,6 @@ public:
void setTextEncoding(const char *encodingName);
bool setTextEOL(const char *s);
void setTextPageBreaks(bool pageBreaks);
- bool setEnableFreeType(const char *s);
void setOverprintPreview(bool overprintPreviewA);
void setPrintCommands(bool printCommandsA);
void setProfileCommands(bool profileCommandsA);
@@ -214,7 +212,6 @@ private:
EndOfLineKind textEOL; // type of EOL marker to use for text
// output
bool textPageBreaks; // insert end-of-page markers?
- bool enableFreeType; // FreeType enable flag
bool overprintPreview; // enable overprint preview
bool printCommands; // print the drawing commands
bool profileCommands; // profile the drawing commands
diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc
index f9d27a53..334074af 100644
--- a/poppler/SplashOutputDev.cc
+++ b/poppler/SplashOutputDev.cc
@@ -1252,6 +1252,7 @@ SplashOutputDev::SplashOutputDev(SplashColorMode colorModeA,
fontAntialias = true;
vectorAntialias = true;
overprintPreview = overprintPreviewA;
+ enableFreeType = true;
enableFreeTypeHinting = false;
enableSlightHinting = false;
setupScreenParams(72.0, 72.0);
@@ -1338,7 +1339,7 @@ void SplashOutputDev::startDoc(PDFDoc *docA) {
delete fontEngine;
}
fontEngine = new SplashFontEngine(
- globalParams->getEnableFreeType(),
+ enableFreeType,
enableFreeTypeHinting,
enableSlightHinting,
getFontAntialias() &&
diff --git a/poppler/SplashOutputDev.h b/poppler/SplashOutputDev.h
index dfd0cdbf..2be20036 100644
--- a/poppler/SplashOutputDev.h
+++ b/poppler/SplashOutputDev.h
@@ -389,6 +389,7 @@ public:
void setFontAntialias(bool anti) { fontAntialias = anti; }
void setFreeTypeHinting(bool enable, bool enableSlightHinting);
+ void setEnableFreeType(bool enable) { enableFreeType = enable; }
protected:
void doUpdateFont(GfxState *state);
@@ -433,6 +434,7 @@ private:
bool fontAntialias;
bool vectorAntialias;
bool overprintPreview;
+ bool enableFreeType;
bool enableFreeTypeHinting;
bool enableSlightHinting;
bool reverseVideo; // reverse video mode
diff --git a/qt5/src/ArthurOutputDev.cc b/qt5/src/ArthurOutputDev.cc
index 1dee1794..b0b39462 100644
--- a/qt5/src/ArthurOutputDev.cc
+++ b/qt5/src/ArthurOutputDev.cc
@@ -181,10 +181,6 @@ void ArthurOutputDev::startDoc(PDFDoc* doc) {
xref = doc->getXRef();
m_doc = doc;
- if (!globalParams->getEnableFreeType()) {
- qCritical() << "Arthur backend will not render text without FreeType, but it is disabled!";
- }
-
for (auto& codeToGID : m_codeToGIDCache) {
gfree(const_cast<int*>(codeToGID.second));
}
diff --git a/utils/pdftoppm.cc b/utils/pdftoppm.cc
index 1696ffdb..30966c22 100644
--- a/utils/pdftoppm.cc
+++ b/utils/pdftoppm.cc
@@ -100,6 +100,7 @@ static bool jpegProgressive = false;
static bool jpegOptimize = false;
static bool overprint = false;
static char enableFreeTypeStr[16] = "";
+static bool enableFreeType = true;
static char antialiasStr[16] = "";
static char vectorAntialiasStr[16] = "";
static bool fontAntialias = true;
@@ -367,6 +368,7 @@ static void processPageJobs() {
splashModeRGB8, 4, false, *pageJob.paperColor, true, thinLineMode);
splashOut->setFontAntialias(fontAntialias);
splashOut->setVectorAntialias(vectorAntialias);
+ splashOut->setEnableFreeType(enableFreeType);
splashOut->startDoc(pageJob.doc);
savePageSlice(pageJob.doc, splashOut, pageJob.pg, x, y, w, h, pageJob.pg_w, pageJob.pg_h, pageJob.ppmFile);
@@ -443,7 +445,7 @@ int main(int argc, char *argv[]) {
// read config file
globalParams = std::make_unique<GlobalParams>();
if (enableFreeTypeStr[0]) {
- if (!globalParams->setEnableFreeType(enableFreeTypeStr)) {
+ if (!GlobalParams::parseYesNo2(enableFreeTypeStr, &enableFreeType)) {
fprintf(stderr, "Bad '-freetype' value on command line\n");
}
}
@@ -539,6 +541,7 @@ int main(int argc, char *argv[]) {
splashOut->setFontAntialias(fontAntialias);
splashOut->setVectorAntialias(vectorAntialias);
+ splashOut->setEnableFreeType(enableFreeType);
splashOut->startDoc(doc);
#endif // UTILS_USE_PTHREADS
More information about the poppler
mailing list