diff --git a/generators/spectre/conf/gssettings.kcfg b/generators/spectre/conf/gssettings.kcfg index b176f7385..e52667276 100644 --- a/generators/spectre/conf/gssettings.kcfg +++ b/generators/spectre/conf/gssettings.kcfg @@ -5,14 +5,6 @@ http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - - - Anti-aliasing makes the result look better, but it makes the display take longer - - - - Anti-aliasing makes the result look better, but it makes the display take longer - Determines whether Ghostscript should be allowed to use platform fonts, if false only usage of fonts embedded in the document will be allowed diff --git a/generators/spectre/conf/gssettingswidget.ui b/generators/spectre/conf/gssettingswidget.ui index 794fca571..6fe850134 100644 --- a/generators/spectre/conf/gssettingswidget.ui +++ b/generators/spectre/conf/gssettingswidget.ui @@ -6,7 +6,7 @@ 0 0 328 - 131 + 73 @@ -28,26 +28,6 @@ General Settings - - - - Anti-aliasing makes the result look better, but it makes the display take longer - - - &Enable anti-aliasing of fonts - - - - - - - Anti-aliasing makes the result look better, but it makes the display take longer - - - &Enable anti-aliasing of graphics - - - diff --git a/generators/spectre/generator_ghostview.cpp b/generators/spectre/generator_ghostview.cpp index 2a2b9cf70..ac43b6012 100644 --- a/generators/spectre/generator_ghostview.cpp +++ b/generators/spectre/generator_ghostview.cpp @@ -70,7 +70,23 @@ GSGenerator::~GSGenerator() bool GSGenerator::reparseConfig() { - return false; + bool changed = false; + if (m_internalDocument) + { +#define SET_HINT(hintname, hintdefvalue, hintvar) \ +{ \ + bool newhint = documentMetaData(hintname, hintdefvalue).toBool(); \ + if (newhint != cache_##hintvar) \ + { \ + cache_##hintvar = newhint; \ + changed = true; \ + } \ +} + SET_HINT("GraphicsAntialias", true, AAgfx) + SET_HINT("TextAntialias", true, AAtext) +#undef SET_HINT + } + return changed; } void GSGenerator::addPages( KConfigDialog *dlg ) @@ -135,6 +151,9 @@ bool GSGenerator::print( QPrinter& printer ) bool GSGenerator::loadDocument( const QString & fileName, QVector< Okular::Page * > & pagesVector ) { + cache_AAtext = documentMetaData("TextAntialias", true).toBool(); + cache_AAgfx = documentMetaData("GraphicsAntialias", true).toBool(); + m_internalDocument = spectre_document_new(); spectre_document_load(m_internalDocument, QFile::encodeName(fileName)); pagesVector.resize( spectre_document_get_n_pages(m_internalDocument) ); @@ -197,8 +216,8 @@ void GSGenerator::generatePixmap( Okular::PixmapRequest * req ) renderer->setPlatformFonts(GSSettings::platformFonts()); int graphicsAA = 1; int textAA = 1; - if (GSSettings::graphicsAntialiasing()) graphicsAA = 4; - if (GSSettings::textAntialiasing()) textAA = 2; + if (cache_AAgfx) graphicsAA = 4; + if (cache_AAtext) textAA = 2; renderer->setAABits(graphicsAA, textAA); renderer->setRotation( req->page()->orientation() * 90 ); diff --git a/generators/spectre/generator_ghostview.h b/generators/spectre/generator_ghostview.h index a44d421fb..419a9d6bf 100644 --- a/generators/spectre/generator_ghostview.h +++ b/generators/spectre/generator_ghostview.h @@ -62,6 +62,9 @@ class GSGenerator : public Okular::Generator, public Okular::ConfigInterface, pu Okular::DocumentInfo *m_docInfo; Okular::PixmapRequest *m_request; + + bool cache_AAtext; + bool cache_AAgfx; }; #endif