diff options
-rw-r--r-- | .SRCINFO | 22 | ||||
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | 0001-Cairo-backend-added-to-Qt5-wrapper.patch | 166 | ||||
-rw-r--r-- | 0002-Setting-default-Qt5-backend-to-Cairo.patch | 24 | ||||
-rw-r--r-- | 0003-Apply-subpixel-rendering-in-Cairo-Backend.patch | 299 | ||||
-rw-r--r-- | 0003-Don-t-build-the-main-poppler-library.patch (renamed from 0004-Don-t-build-the-main-poppler-library.patch) | 8 | ||||
-rw-r--r-- | PKGBUILD | 14 |
7 files changed, 116 insertions, 418 deletions
@@ -1,6 +1,6 @@ pkgbase = poppler-qt-lcd pkgdesc = Poppler Qt bindings, with patches to allow subpixel rendering via Cairo - pkgver = 0.90.0 + pkgver = 0.90.1 pkgrel = 1 url = https://github.com/giddie/poppler-cairo-backend arch = i686 @@ -10,22 +10,20 @@ pkgbase = poppler-qt-lcd makedepends = pkgconfig depends = qt5-base depends = cairo - depends = poppler>=0.90.0 - provides = poppler-qt=0.90.0 - provides = poppler-qt5=0.90.0 + depends = poppler>=0.90.1 + provides = poppler-qt=0.90.1 + provides = poppler-qt5=0.90.1 conflicts = poppler-qt conflicts = poppler-qt4 conflicts = poppler-qt5 - source = http://poppler.freedesktop.org/poppler-0.90.0.tar.xz + source = http://poppler.freedesktop.org/poppler-0.90.1.tar.xz source = 0001-Cairo-backend-added-to-Qt5-wrapper.patch source = 0002-Setting-default-Qt5-backend-to-Cairo.patch - source = 0003-Apply-subpixel-rendering-in-Cairo-Backend.patch - source = 0004-Don-t-build-the-main-poppler-library.patch - md5sums = 5af9e25d8d2b9efc0d538ce2213be22e - md5sums = b1a858ca760121cb90e124a8abccaf54 - md5sums = f49c3fd78d35a10a51823cf22fdbe062 - md5sums = d294271efda705ddf9599845d1f11278 - md5sums = 814117bb456f8106f59562ec6783d9fe + source = 0003-Don-t-build-the-main-poppler-library.patch + md5sums = b80a82f14459d31d929db421b0e8cf05 + md5sums = 42ad721f7ac612f08acd91dabbbbd332 + md5sums = 447925b5d37db980c7e59be2b9ddb30c + md5sums = 4dfbe4ccd0fc769292cc942e7c0163eb pkgname = poppler-qt-lcd diff --git a/.gitignore b/.gitignore index 35abb9ee4b92..04b0d219a56d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.swp *.tar.xz +*.tar.zst /src /pkg diff --git a/0001-Cairo-backend-added-to-Qt5-wrapper.patch b/0001-Cairo-backend-added-to-Qt5-wrapper.patch index d27ff02216f3..10bddde8c194 100644 --- a/0001-Cairo-backend-added-to-Qt5-wrapper.patch +++ b/0001-Cairo-backend-added-to-Qt5-wrapper.patch @@ -1,7 +1,7 @@ -From 827a4c097a92a60888499d9d5e4f292e5625b038 Mon Sep 17 00:00:00 2001 +From c2b4195e04fdffe56f6bd7452760c02cf410b8a1 Mon Sep 17 00:00:00 2001 From: Paul Gideon Dann <pdgiddie@gmail.com> Date: Wed, 4 Apr 2018 16:36:56 +0100 -Subject: [PATCH 1/4] Cairo backend added to Qt5 wrapper +Subject: [PATCH 1/3] Cairo backend added to Qt5 wrapper --- qt5/src/CMakeLists.txt | 15 ++++++++ @@ -52,21 +52,21 @@ index 0247fa3f..f52e4a3b 100644 target_link_libraries(poppler-qt5 poppler ${poppler_LIBS}) endif() diff --git a/qt5/src/poppler-document.cc b/qt5/src/poppler-document.cc -index cc6f01ad..882db5c8 100644 +index 6828da4d..37b11229 100644 --- a/qt5/src/poppler-document.cc +++ b/qt5/src/poppler-document.cc -@@ -721,6 +721,9 @@ namespace Poppler { - ret << Document::SplashBackend; +@@ -692,6 +692,9 @@ QSet<Document::RenderBackend> Document::availableRenderBackends() + ret << Document::SplashBackend; #endif - ret << Document::ArthurBackend; + ret << Document::ArthurBackend; +#if defined(HAVE_CAIRO) -+ ret << Document::CairoBackend; ++ ret << Document::CairoBackend; +#endif - return ret; - } + return ret; + } diff --git a/qt5/src/poppler-page.cc b/qt5/src/poppler-page.cc -index 3e67fedd..170728a1 100644 +index af7e4a11..992e6f00 100644 --- a/qt5/src/poppler-page.cc +++ b/qt5/src/poppler-page.cc @@ -50,6 +50,7 @@ @@ -78,8 +78,8 @@ index 3e67fedd..170728a1 100644 #include <Catalog.h> #include <Form.h> @@ -63,6 +64,9 @@ - #include <SplashOutputDev.h> - #include <splash/SplashBitmap.h> + # include <SplashOutputDev.h> + # include <splash/SplashBitmap.h> #endif +#if defined(HAVE_CAIRO) +#include <CairoOutputDev.h> @@ -87,100 +87,100 @@ index 3e67fedd..170728a1 100644 #include "poppler-private.h" #include "poppler-page-transition-private.h" -@@ -639,6 +643,70 @@ QImage Page::renderToImage(double xres, double yres, int xPos, int yPos, int w, - img = tmpimg; - break; +@@ -556,6 +560,69 @@ QImage Page::renderToImage(double xres, double yres, int xPos, int yPos, int w, + img = tmpimg; + break; } -+ case Poppler::Document::CairoBackend: -+ { ++ case Poppler::Document::CairoBackend: { +#if defined(HAVE_CAIRO) -+ CairoOutputDev *output_dev = new CairoOutputDev(); -+ output_dev->startDoc(m_page->parentDoc->doc); -+ int buffer_width, buffer_height, rotate; -+ cairo_surface_t *surface; -+ cairo_t *cairo; ++ CairoOutputDev *output_dev = new CairoOutputDev(); ++ output_dev->startDoc(m_page->parentDoc->doc); ++ int buffer_width, buffer_height, rotate; ++ cairo_surface_t *surface; ++ cairo_t *cairo; + -+ // If w or h are -1, that indicates the whole page, so we need to -+ // calculate how many pixels that corresponds to. Otherwise, we can use w -+ // or h directly for our buffer size. -+ const QSize pageSize = this->pageSize(); -+ if (w == -1) { -+ const double xscale = xres / 72.0; -+ const double width = pageSize.width();; -+ buffer_width = (int) ceil(width * xscale); -+ } else { -+ buffer_width = w; -+ } -+ if (h == -1) { -+ const double yscale = yres / 72.0; -+ const double height = pageSize.height(); -+ buffer_height = (int) ceil(height * yscale); -+ } else { -+ buffer_height = h; -+ } ++ // If w or h are -1, that indicates the whole page, so we need to ++ // calculate how many pixels that corresponds to. Otherwise, we can use w ++ // or h directly for our buffer size. ++ const QSize pageSize = this->pageSize(); ++ if (w == -1) { ++ const double xscale = xres / 72.0; ++ const double width = pageSize.width();; ++ buffer_width = (int) ceil(width * xscale); ++ } else { ++ buffer_width = w; ++ } ++ if (h == -1) { ++ const double yscale = yres / 72.0; ++ const double height = pageSize.height(); ++ buffer_height = (int) ceil(height * yscale); ++ } else { ++ buffer_height = h; ++ } + -+ rotate = rotation + m_page->page->getRotate(); ++ rotate = rotation + m_page->page->getRotate(); + -+ // FIXME: Okular never provides a rotation value, so I don't have any way -+ // of testing this right now. The result is that subpixels are ordered -+ // incorrectly when the page is rotated. ++ // FIXME: Okular never provides a rotation value, so I don't have any way ++ // of testing this right now. The result is that subpixels are ordered ++ // incorrectly when the page is rotated. + -+ //if (rotate == 90 || rotate == 270) { -+ // const double temp = height; -+ // height = width; -+ // width = temp; -+ //} ++ //if (rotate == 90 || rotate == 270) { ++ // const double temp = height; ++ // height = width; ++ // width = temp; ++ //} + -+ img = QImage(buffer_width, buffer_height, QImage::Format_ARGB32); -+ img.fill(Qt::white); // Never transparent ++ img = QImage(buffer_width, buffer_height, QImage::Format_ARGB32); ++ img.fill(Qt::white); // Never transparent + -+ surface = cairo_image_surface_create_for_data( -+ img.bits(), -+ CAIRO_FORMAT_ARGB32, -+ buffer_width, buffer_height, -+ img.bytesPerLine()); ++ surface = cairo_image_surface_create_for_data( ++ img.bits(), ++ CAIRO_FORMAT_ARGB32, ++ buffer_width, buffer_height, ++ img.bytesPerLine()); + -+ cairo = cairo_create(surface); -+ output_dev->setCairo(cairo); ++ cairo = cairo_create(surface); ++ output_dev->setCairo(cairo); + -+ m_page->parentDoc->doc->displayPageSlice( -+ output_dev, m_page->index + 1, xres, yres, rotation, false, true, -+ false, xPos, yPos, w, h); ++ m_page->parentDoc->doc->displayPageSlice( ++ output_dev, m_page->index + 1, xres, yres, rotation, false, true, ++ false, xPos, yPos, w, h); + -+ // Clean up -+ output_dev->setCairo(nullptr); -+ cairo_destroy(cairo); -+ cairo_surface_destroy(surface); -+ delete output_dev; ++ // Clean up ++ output_dev->setCairo(nullptr); ++ cairo_destroy(cairo); ++ cairo_surface_destroy(surface); ++ delete output_dev; +#endif -+ break; ++ break; + } - } + } - if (shouldAbortRenderCallback && shouldAbortRenderCallback(payload)) -@@ -664,6 +732,8 @@ bool Page::renderToPainter(QPainter* painter, double xres, double yres, int x, i + if (shouldAbortRenderCallback && shouldAbortRenderCallback(payload)) +@@ -579,6 +646,9 @@ bool Page::renderToPainter(QPainter *painter, double xres, double yres, int x, i return renderToArthur(&arthur_output, painter, m_page, xres, yres, x, y, w, h, rotate, flags); } -+ case Poppler::Document::CairoBackend: ++ case Poppler::Document::CairoBackend: { + return false; - } - return false; ++ } + } + return false; } diff --git a/qt5/src/poppler-qt5.h b/qt5/src/poppler-qt5.h -index 06f6d021..35d8cc17 100644 +index 3bcf2e33..47f01255 100644 --- a/qt5/src/poppler-qt5.h +++ b/qt5/src/poppler-qt5.h -@@ -1154,7 +1154,8 @@ delete it; - */ - enum RenderBackend { - SplashBackend, ///< Splash backend -- ArthurBackend ///< Arthur (Qt) backend -+ ArthurBackend, ///< Arthur (Qt) backend -+ CairoBackend ///< Cairo backend - }; +@@ -1166,7 +1166,8 @@ public: + enum RenderBackend + { + SplashBackend, ///< Splash backend +- ArthurBackend ///< Arthur (Qt) backend ++ ArthurBackend, ///< Arthur (Qt) backend ++ CairoBackend ///< Cairo backend + }; - /** + /** diff --git a/qt5/tests/CMakeLists.txt b/qt5/tests/CMakeLists.txt index b01d0835..561cb5dd 100644 --- a/qt5/tests/CMakeLists.txt diff --git a/0002-Setting-default-Qt5-backend-to-Cairo.patch b/0002-Setting-default-Qt5-backend-to-Cairo.patch index d953635a0172..74a66aaa5080 100644 --- a/0002-Setting-default-Qt5-backend-to-Cairo.patch +++ b/0002-Setting-default-Qt5-backend-to-Cairo.patch @@ -1,25 +1,25 @@ -From a4f2390cb3695569ed09b679d381a0f80e90e0a1 Mon Sep 17 00:00:00 2001 +From be00986c238c903e78d969089dd73f98c8dd61bf Mon Sep 17 00:00:00 2001 From: Paul Gideon Dann <pdgiddie@gmail.com> Date: Wed, 4 Apr 2018 16:37:38 +0100 -Subject: [PATCH 2/4] Setting default Qt5 backend to Cairo +Subject: [PATCH 2/3] Setting default Qt5 backend to Cairo --- qt5/src/poppler-private.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt5/src/poppler-private.cc b/qt5/src/poppler-private.cc -index 02fb96e6..8e3ed4a6 100644 +index 827a6345..760973f7 100644 --- a/qt5/src/poppler-private.cc +++ b/qt5/src/poppler-private.cc -@@ -243,7 +243,7 @@ namespace Debug { - - void DocumentData::init() - { -- m_backend = Document::SplashBackend; -+ m_backend = Document::CairoBackend; - paperColor = Qt::white; - m_hints = 0; - m_optContentModel = nullptr; +@@ -242,7 +242,7 @@ DocumentData::~DocumentData() + + void DocumentData::init() + { +- m_backend = Document::SplashBackend; ++ m_backend = Document::CairoBackend; + paperColor = Qt::white; + m_hints = 0; + m_optContentModel = nullptr; -- 2.27.0 diff --git a/0003-Apply-subpixel-rendering-in-Cairo-Backend.patch b/0003-Apply-subpixel-rendering-in-Cairo-Backend.patch deleted file mode 100644 index 5973df5f42a9..000000000000 --- a/0003-Apply-subpixel-rendering-in-Cairo-Backend.patch +++ /dev/null @@ -1,299 +0,0 @@ -From f7b6ba8787b2bf6c0a9c9f3b7465c88e0c9ece08 Mon Sep 17 00:00:00 2001 -From: Paul Gideon Dann <pdgiddie@gmail.com> -Date: Tue, 9 Aug 2016 15:02:53 +0100 -Subject: [PATCH 3/4] Apply subpixel rendering in Cairo Backend - -Source: -https://github.com/zhou13/poppler-subpixel/blob/master/poppler/poppler-subpixel.patch ---- - glib/demo/render.c | 25 ++++++++++++++++++++--- - glib/poppler-page.cc | 10 ++++++++++ - glib/poppler-page.h | 1 + - poppler/CairoFontEngine.cc | 6 +++--- - poppler/CairoOutputDev.cc | 24 ++++++++++++++++++++++ - poppler/Gfx.cc | 41 ++++++++++++++++++++++++++++++++++++++ - poppler/Gfx.h | 3 +++ - poppler/Page.cc | 13 ++++++++++++ - poppler/Page.h | 3 +++ - 9 files changed, 120 insertions(+), 6 deletions(-) - -diff --git a/glib/demo/render.c b/glib/demo/render.c -index 78d24bb5..d482ceb5 100644 ---- a/glib/demo/render.c -+++ b/glib/demo/render.c -@@ -82,12 +82,14 @@ pgd_render_start (GtkButton *button, - PgdRenderDemo *demo) - { - PopplerPage *page; -+ gboolean subpixel_rendering; - gdouble page_width, page_height; - gdouble width, height; - gint x, y; - gchar *str; - GTimer *timer; - cairo_t *cr; -+ cairo_font_options_t *fo; - - page = poppler_document_get_page (demo->doc, demo->page); - if (!page) -@@ -116,6 +118,21 @@ pgd_render_start (GtkButton *button, - width, height); - cr = cairo_create (demo->surface); - -+ fo = cairo_font_options_create (); -+ cairo_get_font_options (cr, fo); -+ -+ subpixel_rendering = poppler_page_support_subpixel_rendering (page); -+ printf("subpixel_rendering %d\n", subpixel_rendering); -+ if (subpixel_rendering) { -+ cairo_set_source_rgb (cr, 1., 1., 1.); -+ cairo_paint (cr); -+ cairo_font_options_set_antialias (fo, CAIRO_ANTIALIAS_SUBPIXEL); -+ cairo_font_options_set_subpixel_order (fo, CAIRO_SUBPIXEL_ORDER_RGB); -+ } -+ -+ cairo_set_font_options (cr, fo); -+ cairo_font_options_destroy (fo); -+ - cairo_save (cr); - switch (demo->rotate) { - case 90: -@@ -143,9 +160,11 @@ pgd_render_start (GtkButton *button, - poppler_page_render (page, cr); - cairo_restore (cr); - -- cairo_set_operator (cr, CAIRO_OPERATOR_DEST_OVER); -- cairo_set_source_rgb (cr, 1., 1., 1.); -- cairo_paint (cr); -+ if (!subpixel_rendering) { -+ cairo_set_operator (cr, CAIRO_OPERATOR_DEST_OVER); -+ cairo_set_source_rgb (cr, 1., 1., 1.); -+ cairo_paint (cr); -+ } - - g_timer_stop (timer); - -diff --git a/glib/poppler-page.cc b/glib/poppler-page.cc -index f237bb69..73afea17 100644 ---- a/glib/poppler-page.cc -+++ b/glib/poppler-page.cc -@@ -2693,3 +2693,13 @@ poppler_page_get_text_attributes_for_area (PopplerPage *page, - - return g_list_reverse(attributes); - } -+ -+gboolean -+poppler_page_support_subpixel_rendering (PopplerPage *page) -+{ -+ CairoOutputDev *output_dev; -+ g_return_val_if_fail (POPPLER_IS_PAGE (page), FALSE); -+ -+ output_dev = page->document->output_dev; -+ return page->page->supportSubpixelRendering(output_dev); -+} -diff --git a/glib/poppler-page.h b/glib/poppler-page.h -index 0ffc50c6..6fc75d92 100644 ---- a/glib/poppler-page.h -+++ b/glib/poppler-page.h -@@ -150,6 +150,7 @@ void poppler_page_free_text_attributes (GList *li - POPPLER_PUBLIC - GList * poppler_page_get_text_attributes_for_area (PopplerPage *page, - PopplerRectangle *area); -+gboolean poppler_page_support_subpixel_rendering (PopplerPage *page); - - /* A rectangle on a page, with coordinates in PDF points. */ - #define POPPLER_TYPE_RECTANGLE (poppler_rectangle_get_type ()) -diff --git a/poppler/CairoFontEngine.cc b/poppler/CairoFontEngine.cc -index 1f637cf5..3de0a45e 100644 ---- a/poppler/CairoFontEngine.cc -+++ b/poppler/CairoFontEngine.cc -@@ -124,7 +124,7 @@ CairoFont::getSubstitutionCorrection(GfxFont *gfxFont) - cairo_matrix_t m; - cairo_matrix_init_identity(&m); - cairo_font_options_t *options = cairo_font_options_create(); -- cairo_font_options_set_hint_style(options, CAIRO_HINT_STYLE_NONE); -+ cairo_font_options_set_hint_style(options, CAIRO_HINT_STYLE_SLIGHT); - cairo_font_options_set_hint_metrics(options, CAIRO_HINT_METRICS_OFF); - cairo_scaled_font_t *scaled_font = cairo_scaled_font_create(cairo_font_face, &m, &m, options); - -@@ -182,7 +182,7 @@ _ft_new_face_uncached (FT_Library lib, - } - - font_face = cairo_ft_font_face_create_for_ft_face (face, -- FT_LOAD_NO_HINTING | -+ FT_LOAD_TARGET_LIGHT | - FT_LOAD_NO_BITMAP); - if (cairo_font_face_set_user_data (font_face, - &_ft_cairo_key, -@@ -351,7 +351,7 @@ _ft_new_face (FT_Library lib, - _ft_open_faces = l; - - l->font_face = cairo_ft_font_face_create_for_ft_face (tmpl.face, -- FT_LOAD_NO_HINTING | -+ FT_LOAD_TARGET_LIGHT | - FT_LOAD_NO_BITMAP); - if (cairo_font_face_set_user_data (l->font_face, - &_ft_cairo_key, -diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc -index 83f1c78d..7f1442f1 100644 ---- a/poppler/CairoOutputDev.cc -+++ b/poppler/CairoOutputDev.cc -@@ -205,6 +205,13 @@ void CairoOutputDev::setCairo(cairo_t *c) - } - if (c != nullptr) { - cairo = cairo_reference (c); -+ { -+ cairo_font_options_t *options = cairo_font_options_create (); -+ cairo_get_font_options (cairo, options); -+ cairo_font_options_set_antialias (options, CAIRO_ANTIALIAS_SUBPIXEL); -+ cairo_set_font_options (cairo, options); -+ cairo_font_options_destroy (options); -+ } - /* save the initial matrix so that we can use it for type3 fonts. */ - //XXX: is this sufficient? could we miss changes to the matrix somehow? - cairo_get_matrix(cairo, &orig_matrix); -@@ -1455,6 +1462,7 @@ void CairoOutputDev::drawChar(GfxState *state, double x, double y, - void CairoOutputDev::endString(GfxState *state) - { - int render; -+ GfxFontType fontType; - - if (!currentFont) - return; -@@ -1472,6 +1480,18 @@ void CairoOutputDev::endString(GfxState *state) - goto finish; - } - -+ fontType = state->getFont()->getType(); -+ // Do not enable subpixel rendering for type3 font -+ // For some reason it does not work -+ if (fontType == fontType3) { -+ cairo_save(cairo); -+ cairo_font_options_t *fo; -+ fo = cairo_font_options_create (); -+ cairo_get_font_options (cairo, fo); -+ cairo_font_options_set_antialias (fo, CAIRO_ANTIALIAS_DEFAULT); -+ cairo_set_font_options (cairo, fo); -+ } -+ - if (!(render & 1)) { - LOG (printf ("fill string\n")); - cairo_set_source (cairo, fill_pattern); -@@ -1522,6 +1542,10 @@ void CairoOutputDev::endString(GfxState *state) - } - - finish: -+ // pair with the previous cairo_save to disable subpixel rendering for type3 fonts -+ if (fontType == fontType3) { -+ cairo_restore(cairo); -+ } - gfree (glyphs); - glyphs = nullptr; - if (use_show_text_glyphs) { -diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc -index 37a8996a..7f75efb1 100644 ---- a/poppler/Gfx.cc -+++ b/poppler/Gfx.cc -@@ -4597,6 +4597,47 @@ void Gfx::doImage(Object *ref, Stream *str, bool inlineImg) { - error(errSyntaxError, getPos(), "Bad image parameters"); - } - -+bool Gfx::checkNormalBlendModeOnly(Object *str) { -+ printf("check blender mode start\n"); -+ Object args[maxArgs]; -+ int numArgs; -+ bool onlyNormalBlendMode; -+ Parser myParser(xref, str, false); -+ -+ numArgs = 0; -+ onlyNormalBlendMode = true; -+ -+ Object obj = myParser.getObj(); -+ while (!obj.isEOF()) { -+ if (obj.isCmd()) { -+ const char* cmd = obj.getCmd(); -+ -+ if (strcmp(cmd, "gs") == 0) { -+ GfxBlendMode mode; -+ Object obj1 = res->lookupGState(args[0].getName()); -+ if (!obj1.isNull()) { -+ Object obj2 = obj1.dictLookup("BM"); -+ if (!obj2.isNull()) { -+ if (state->parseBlendMode(&obj2, &mode)) { -+ printf("check blend mode: %d\n", mode); -+ onlyNormalBlendMode &= (mode == gfxBlendNormal); -+ } -+ } -+ } -+ } -+ -+ numArgs = 0; -+ } else if (numArgs < maxArgs) { -+ args[numArgs++] = obj.copy(); -+ } -+ -+ obj = myParser.getObj(); -+ } -+ -+ return onlyNormalBlendMode; -+} -+ -+ - bool Gfx::checkTransparencyGroup(Dict *resDict) { - // check the effect of compositing objects as a group: - // look for ExtGState entries with ca != 1 or CA != 1 or BM != normal -diff --git a/poppler/Gfx.h b/poppler/Gfx.h -index e8ff605f..f615d789 100644 ---- a/poppler/Gfx.h -+++ b/poppler/Gfx.h -@@ -193,6 +193,9 @@ public: - // Get the current graphics state object. - GfxState *getState() { return state; } - -+ // Check whether a stream only contains normal blend mode (to enable subpixel rendering) -+ bool checkNormalBlendModeOnly(Object *str); -+ - bool checkTransparencyGroup(Dict *resDict); - - void drawForm(Object *str, Dict *resDict, const double *matrix, const double *bbox, -diff --git a/poppler/Page.cc b/poppler/Page.cc -index a875f7bd..c296555a 100644 ---- a/poppler/Page.cc -+++ b/poppler/Page.cc -@@ -342,6 +342,19 @@ Dict *Page::getResourceDictCopy(XRef *xrefA) { - return dict ? dict->copy(xrefA) : nullptr; - } - -+bool Page::supportSubpixelRendering(OutputDev *out) { -+ bool supported = false; -+ PDFRectangle box; -+ -+ Object obj = contents.fetch(xref); -+ if (!obj.isNull()) { -+ Gfx gfx(doc, out, attrs->getResourceDict(), &box, nullptr); -+ supported = gfx.checkNormalBlendModeOnly(&obj); -+ } -+ -+ return supported; -+} -+ - void Page::replaceXRef(XRef *xrefA) { - Dict *pageDict = pageObj.getDict()->copy(xrefA); - xref = xrefA; -diff --git a/poppler/Page.h b/poppler/Page.h -index 2b19a089..57ead29c 100644 ---- a/poppler/Page.h -+++ b/poppler/Page.h -@@ -187,6 +187,9 @@ public: - Object *getResourceDictObject(); - Dict *getResourceDictCopy(XRef *xrefA); - -+ // Whether the content in this page supports subpixel rendering (lcdfilter) -+ bool supportSubpixelRendering(OutputDev *out); -+ - // Get annotations array. - Object getAnnotsObject(XRef *xrefA = nullptr) { return annotsObj.fetch(xrefA ? xrefA : xref); } - // Add a new annotation to the page --- -2.27.0 - diff --git a/0004-Don-t-build-the-main-poppler-library.patch b/0003-Don-t-build-the-main-poppler-library.patch index ceeea3e22191..93bdf4d8e20f 100644 --- a/0004-Don-t-build-the-main-poppler-library.patch +++ b/0003-Don-t-build-the-main-poppler-library.patch @@ -1,17 +1,17 @@ -From 4d7f9500478ada96e135d64d3609c007a48d649d Mon Sep 17 00:00:00 2001 +From 91a177cd37e966653cc2c9ee401dbab5847f92e1 Mon Sep 17 00:00:00 2001 From: Paul Gideon Dann <pdgiddie@gmail.com> Date: Tue, 20 Oct 2009 18:32:35 +0100 -Subject: [PATCH 4/4] Don't build the main poppler library. +Subject: [PATCH 3/3] Don't build the main poppler library. --- CMakeLists.txt | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt -index 533abb03..6eb8b9fe 100644 +index 855ed842..b232915e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -533,23 +533,6 @@ ADD_GPERF_FILE(TimesItalicWidths) +@@ -544,23 +544,6 @@ ADD_GPERF_FILE(TimesItalicWidths) ADD_GPERF_FILE(TimesRomanWidths) ADD_GPERF_FILE(ZapfDingbatsWidths) @@ -2,7 +2,7 @@ # Maintainer: Paul Gideon Dann <pdgiddie_at_gmail.com> pkgname=poppler-qt-lcd -pkgver=0.90.0 +pkgver=0.90.1 pkgrel=1 pkgdesc="Poppler Qt bindings, with patches to allow subpixel rendering via Cairo" license=('GPL') @@ -15,13 +15,11 @@ url="https://github.com/giddie/poppler-cairo-backend" source=(http://poppler.freedesktop.org/poppler-${pkgver}.tar.xz 0001-Cairo-backend-added-to-Qt5-wrapper.patch 0002-Setting-default-Qt5-backend-to-Cairo.patch - 0003-Apply-subpixel-rendering-in-Cairo-Backend.patch - 0004-Don-t-build-the-main-poppler-library.patch) -md5sums=('5af9e25d8d2b9efc0d538ce2213be22e' - 'b1a858ca760121cb90e124a8abccaf54' - 'f49c3fd78d35a10a51823cf22fdbe062' - 'd294271efda705ddf9599845d1f11278' - '814117bb456f8106f59562ec6783d9fe') + 0003-Don-t-build-the-main-poppler-library.patch) +md5sums=('b80a82f14459d31d929db421b0e8cf05' + '42ad721f7ac612f08acd91dabbbbd332' + '447925b5d37db980c7e59be2b9ddb30c' + '4dfbe4ccd0fc769292cc942e7c0163eb') build() { cd "${srcdir}/poppler-${pkgver}" |