diff --git a/poppler/SplashOutputDev.h b/poppler/SplashOutputDev.h index ce1d50d..c07cc83 100644 --- a/poppler/SplashOutputDev.h +++ b/poppler/SplashOutputDev.h @@ -165,7 +165,7 @@ public: GBool reverseVideoA, SplashColorPtr paperColorA, GBool bitmapTopDownA = gTrue, GBool allowAntialiasA = gTrue, - SplashThinLineMode thinLineMode = splashThinLineDefault, + SplashThinLineMode thinLineMode = splashThinLineShape, GBool overprintPreviewA = globalParams->getOverprintPreview()); // Destructor. diff --git a/qt4/src/poppler-page.cc b/qt4/src/poppler-page.cc index 7c47573..b5f0a8a 100644 --- a/qt4/src/poppler-page.cc +++ b/qt4/src/poppler-page.cc @@ -294,6 +294,9 @@ QImage Page::renderToImage(double xres, double yres, int x, int y, int w, int h, } GBool AA = m_page->parentDoc->m_hints & Document::TextAntialiasing ? gTrue : gFalse; + SplashThinLineMode thinLineMode = splashThinLineDefault; + if (m_page->parentDoc->m_hints & Document::ThinLineShape) thinLineMode = splashThinLineShape; + if (m_page->parentDoc->m_hints & Document::ThinLineSolid) thinLineMode = splashThinLineSolid; SplashOutputDev * splash_output = new SplashOutputDev( #if defined(SPLASH_CMYK) @@ -301,7 +304,7 @@ QImage Page::renderToImage(double xres, double yres, int x, int y, int w, int h, #else splashModeXBGR8, #endif - 4, gFalse, bgColor, gTrue, AA, splashThinLineDefault, overprint); + 4, gFalse, bgColor, gTrue, AA, thinLineMode, overprint); splash_output->setVectorAntialias(m_page->parentDoc->m_hints & Document::Antialiasing ? gTrue : gFalse); splash_output->setFreeTypeHinting(m_page->parentDoc->m_hints & Document::TextHinting ? gTrue : gFalse, diff --git a/qt4/src/poppler-qt4.h b/qt4/src/poppler-qt4.h index f4f6fc6..39c93a9 100644 --- a/qt4/src/poppler-qt4.h +++ b/qt4/src/poppler-qt4.h @@ -848,7 +848,9 @@ delete it; TextAntialiasing = 0x00000002, ///< Antialiasing for text TextHinting = 0x00000004, ///< Hinting for text \since 0.12.1 TextSlightHinting = 0x00000008, ///< Lighter hinting for text when combined with TextHinting \since 0.18 - OverprintPreview = 0x00000010 ///< Overprint preview \since 0.22 + OverprintPreview = 0x00000010, ///< Overprint preview \since 0.22 + ThinLineSolid = 0x00000020, ///< Enhance thin lines solid \since 0.24 + ThinLineShape = 0x00000040 ///< Enhance thin lines shape \since 0.24 }; Q_DECLARE_FLAGS( RenderHints, RenderHint ) diff --git a/splash/Splash.cc b/splash/Splash.cc index 3a355b8..4b6b7a8 100644 --- a/splash/Splash.cc +++ b/splash/Splash.cc @@ -2456,9 +2456,17 @@ SplashError Splash::fillWithPattern(SplashPath *path, GBool eo, if (clipRes != splashClipAllInside) { state->clip->clipAALine(aaBuf, &x0, &x1, y, thinLineMode != splashThinLineDefault && xMinI == xMaxI); } - drawAALine(&pipe, x0, x1, y, - thinLineMode == splashThinLineShape && (xMinI == xMaxI || yMinI == yMaxI), - clip255(splashRound(state->lineWidth * 255))); + Guchar lineShape = 255; + GBool adjustLine = gFalse; + if (thinLineMode == splashThinLineShape && (xMinI == xMaxI || yMinI == yMaxI)) { + // compute line shape for thin lines: + SplashCoord mx, my, delta; + transform(state->matrix, 0, 0, &mx, &my); + transform(state->matrix, state->lineWidth, 0, &delta, &my); + adjustLine = gTrue; + lineShape = clip255((delta - mx) * 255); + } + drawAALine(&pipe, x0, x1, y, adjustLine, lineShape); } } else { for (y = yMinI; y <= yMaxI; ++y) {