Commit 1496a00a authored by Albert Astals Cid's avatar Albert Astals Cid

Move enableFreeType out of GlobalParams

It's now moved to pdftoppm+SplashOutputDev that were the only users
parent e8e577df
......@@ -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;
......
......@@ -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
......
......@@ -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() &&
......
......@@ -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
......
......@@ -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));
}
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment