@@ -0,0 +1,73 @@
|
||||
From 14a287fc1db2a44abfe1743260554447b31b4adf Mon Sep 17 00:00:00 2001
|
||||
From: Jean Ghali <jghali@libertysurf.fr>
|
||||
Date: Tue, 5 May 2026 22:29:32 +0000
|
||||
Subject: [PATCH] #17808: Fix failure to build with poppler 26.05.0
|
||||
|
||||
git-svn-id: svn://scribus.net/trunk/Scribus@27545 11d20701-8431-0410-a711-e3c959e3b870
|
||||
---
|
||||
scribus/plugins/import/pdf/importpdfconfig.h | 4 ++++
|
||||
scribus/plugins/import/pdf/slaoutput.cpp | 24 +++++++++++++++++---
|
||||
2 files changed, 25 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/scribus/plugins/import/pdf/importpdfconfig.h b/scribus/plugins/import/pdf/importpdfconfig.h
|
||||
index bd4d30f28f16c0955a5053919cae475e7f91086d..cbd5a7e00da314f4f8232565365e2d72eb398eef 100644
|
||||
--- a/scribus/plugins/import/pdf/importpdfconfig.h
|
||||
+++ b/scribus/plugins/import/pdf/importpdfconfig.h
|
||||
@@ -21,4 +21,8 @@ for which a new license (GPL+exception) is in place.
|
||||
#define POPPLER_CONST_25_02
|
||||
#endif
|
||||
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 5, 0)
|
||||
+using SplashCoord = double;
|
||||
+#endif
|
||||
+
|
||||
#endif
|
||||
diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
|
||||
index 2e964358534c3684e3efcdddb2e70da3d7224729..30f82eebf0810809a9132db86b9bbd806f384f9c 100644
|
||||
--- a/scribus/plugins/import/pdf/slaoutput.cpp
|
||||
+++ b/scribus/plugins/import/pdf/slaoutput.cpp
|
||||
@@ -3115,7 +3115,13 @@ void SlaOutputDev::updateFont(GfxState *state)
|
||||
// load the font file
|
||||
switch (fontType) {
|
||||
case fontType1:
|
||||
-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0)
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 5, 0)
|
||||
+ if (!(fontFile = m_fontEngine->loadType1Font(std::move(id), std::move(fontsrc), static_cast<Gfx8BitFont*>(gfxFont)->getEncoding(), fontLoc->fontNum)))
|
||||
+ {
|
||||
+ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)");
|
||||
+ goto err2;
|
||||
+ }
|
||||
+#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0)
|
||||
if (!(fontFile = m_fontEngine->loadType1Font(std::move(id), std::move(fontsrc), (const char**) ((Gfx8BitFont*) gfxFont)->getEncoding(), fontLoc->fontNum)))
|
||||
{
|
||||
error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)");
|
||||
@@ -3136,7 +3142,13 @@ void SlaOutputDev::updateFont(GfxState *state)
|
||||
#endif
|
||||
break;
|
||||
case fontType1C:
|
||||
-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0)
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 5, 0)
|
||||
+ if (!(fontFile = m_fontEngine->loadType1CFont(std::move(id), std::move(fontsrc), static_cast<Gfx8BitFont*>(gfxFont)->getEncoding(), fontLoc->fontNum)))
|
||||
+ {
|
||||
+ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)");
|
||||
+ goto err2;
|
||||
+ }
|
||||
+#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0)
|
||||
if (!(fontFile = m_fontEngine->loadType1CFont(std::move(id), std::move(fontsrc), (const char**) ((Gfx8BitFont*) gfxFont)->getEncoding(), fontLoc->fontNum)))
|
||||
{
|
||||
error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)");
|
||||
@@ -3157,7 +3169,13 @@ void SlaOutputDev::updateFont(GfxState *state)
|
||||
#endif
|
||||
break;
|
||||
case fontType1COT:
|
||||
-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0)
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 5, 0)
|
||||
+ if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(std::move(id), std::move(fontsrc), static_cast<Gfx8BitFont*>(gfxFont)->getEncoding(), fontLoc->fontNum)))
|
||||
+ {
|
||||
+ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)");
|
||||
+ goto err2;
|
||||
+ }
|
||||
+#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0)
|
||||
if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(std::move(id), std::move(fontsrc), (const char**) ((Gfx8BitFont*) gfxFont)->getEncoding(), fontLoc->fontNum)))
|
||||
{
|
||||
error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)");
|
||||
@@ -1,111 +0,0 @@
|
||||
diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
|
||||
index db463b6..eb86be2 100644
|
||||
--- a/scribus/plugins/import/pdf/slaoutput.cpp
|
||||
+++ b/scribus/plugins/import/pdf/slaoutput.cpp
|
||||
@@ -7,6 +7,7 @@ for which a new license (GPL+exception) is in place.
|
||||
|
||||
#include "slaoutput.h"
|
||||
|
||||
+#include <array>
|
||||
#include <memory>
|
||||
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
|
||||
#include <optional>
|
||||
@@ -2495,7 +2496,12 @@ void SlaOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, int
|
||||
{
|
||||
// qDebug() << "Draw Image Mask";
|
||||
auto imgStr = std::make_shared<ImageStream>(str, width, 1, 1);
|
||||
-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 02, 0)
|
||||
+
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 1, 0)
|
||||
+ bool rewindDone = imgStr->rewind();
|
||||
+ if (!rewindDone)
|
||||
+ return;
|
||||
+#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 02, 0)
|
||||
bool resetDone = imgStr->reset();
|
||||
if (!resetDone)
|
||||
return;
|
||||
@@ -2576,7 +2582,12 @@ void SlaOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str
|
||||
{
|
||||
// qDebug() << "SlaOutputDev::drawSoftMaskedImage Masked Image Components" << colorMap->getNumPixelComps();
|
||||
auto imgStr = std::make_shared<ImageStream>(str, width, colorMap->getNumPixelComps(), colorMap->getBits());
|
||||
-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 02, 0)
|
||||
+
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 1, 0)
|
||||
+ bool rewindDone = imgStr->rewind();
|
||||
+ if (!rewindDone)
|
||||
+ return;
|
||||
+#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 02, 0)
|
||||
bool resetDone = imgStr->reset();
|
||||
if (!resetDone)
|
||||
return;
|
||||
@@ -2598,7 +2609,11 @@ void SlaOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str
|
||||
return;
|
||||
|
||||
auto mskStr = std::make_shared<ImageStream>(maskStr, maskWidth, maskColorMap->getNumPixelComps(), maskColorMap->getBits());
|
||||
-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 02, 0)
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 1, 0)
|
||||
+ bool mskRewindDone = mskStr->rewind();
|
||||
+ if (!mskRewindDone)
|
||||
+ return;
|
||||
+#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 02, 0)
|
||||
bool mskResetDone = mskStr->reset();
|
||||
if (!mskResetDone)
|
||||
return;
|
||||
@@ -2660,7 +2675,11 @@ void SlaOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str, i
|
||||
{
|
||||
// qDebug() << "SlaOutputDev::drawMaskedImage";
|
||||
auto imgStr = std::make_shared<ImageStream>(str, width, colorMap->getNumPixelComps(), colorMap->getBits());
|
||||
-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 02, 0)
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 1, 0)
|
||||
+ bool rewindDone = imgStr->rewind();
|
||||
+ if (!rewindDone)
|
||||
+ return;
|
||||
+#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 02, 0)
|
||||
bool resetDone = imgStr->reset();
|
||||
if (resetDone)
|
||||
return;
|
||||
@@ -2682,7 +2701,11 @@ void SlaOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str, i
|
||||
return;
|
||||
|
||||
auto mskStr = std::make_shared<ImageStream>(maskStr, maskWidth, 1, 1);
|
||||
-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 02, 0)
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 1, 0)
|
||||
+ bool mskRewindDone = mskStr->rewind();
|
||||
+ if (!mskRewindDone)
|
||||
+ return;
|
||||
+#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 02, 0)
|
||||
bool mskResetDone = mskStr->reset();
|
||||
if (!mskResetDone)
|
||||
return;
|
||||
@@ -2732,7 +2755,11 @@ void SlaOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str, i
|
||||
void SlaOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, bool interpolate, const int* maskColors, bool inlineImg)
|
||||
{
|
||||
auto imgStr = std::make_shared<ImageStream>(str, width, colorMap->getNumPixelComps(), colorMap->getBits());
|
||||
-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 02, 0)
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 1, 0)
|
||||
+ bool rewindDone = imgStr->rewind();
|
||||
+ if (!rewindDone)
|
||||
+ return;
|
||||
+#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 02, 0)
|
||||
bool resetDone = imgStr->reset();
|
||||
if (!resetDone)
|
||||
return;
|
||||
@@ -3125,10 +3152,18 @@ void SlaOutputDev::updateFont(GfxState *state)
|
||||
#endif
|
||||
const double *textMat = nullptr;
|
||||
double m11, m12, m21, m22, fontSize;
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 1, 0)
|
||||
+ std::array<SplashCoord, 4> mat = { 1.0, 0.0, 0.0, 1.0 };
|
||||
+#else
|
||||
SplashCoord mat[4] = { 1.0, 0.0, 0.0, 1.0 };
|
||||
+#endif
|
||||
int n = 0;
|
||||
int faceIndex = 0;
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 1, 0)
|
||||
+ std::array<SplashCoord, 6> matrix = { 1.0, 0.0, 0.0, 1.0, 0.0, 0.0 };
|
||||
+#else
|
||||
SplashCoord matrix[6] = { 1.0, 0.0, 0.0, 1.0, 0.0, 0.0 };
|
||||
+#endif
|
||||
|
||||
m_font = nullptr;
|
||||
|
||||
@@ -1,413 +0,0 @@
|
||||
Index: Scribus/scribus/plugins/import/pdf/importpdf.cpp
|
||||
===================================================================
|
||||
--- Scribus/scribus/plugins/import/pdf/importpdf.cpp (revision 27386)
|
||||
+++ Scribus/scribus/plugins/import/pdf/importpdf.cpp (revision 27389)
|
||||
@@ -79,7 +79,11 @@
|
||||
bgColor[0] = 255;
|
||||
bgColor[1] = 255;
|
||||
bgColor[2] = 255;
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0)
|
||||
+ SplashOutputDev dev(splashModeXBGR8, 4, bgColor, true);
|
||||
+#else
|
||||
SplashOutputDev dev(splashModeXBGR8, 4, false, bgColor, true);
|
||||
+#endif
|
||||
dev.setVectorAntialias(true);
|
||||
dev.setFreeTypeHinting(true, false);
|
||||
dev.startDoc(&pdfDoc);
|
||||
@@ -154,20 +158,17 @@
|
||||
}
|
||||
double docWidth = PrefsManager::instance().appPrefs.docSetupPrefs.pageWidth;
|
||||
double docHeight = PrefsManager::instance().appPrefs.docSetupPrefs.pageHeight;
|
||||
- if (!m_interactive || (flags & LoadSavePlugin::lfInsertPage))
|
||||
+ if (m_Doc && (!m_interactive || (flags & LoadSavePlugin::lfInsertPage)))
|
||||
{
|
||||
m_Doc->setPage(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, false);
|
||||
m_Doc->addPage(0);
|
||||
m_Doc->view()->addPage(0, true);
|
||||
}
|
||||
- else
|
||||
+ else if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
|
||||
{
|
||||
- if (!m_Doc || (flags & LoadSavePlugin::lfCreateDoc))
|
||||
- {
|
||||
- m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, 0, 0, 0, 0, 1, "Custom", true);
|
||||
- ScCore->primaryMainWindow()->HaveNewDoc();
|
||||
- ret = true;
|
||||
- }
|
||||
+ m_Doc = ScCore->primaryMainWindow()->doFileNew(docWidth, docHeight, 0, 0, 0, 0, 0, 0, false, 0, 0, 0, 0, 1, "Custom", true);
|
||||
+ ScCore->primaryMainWindow()->HaveNewDoc();
|
||||
+ ret = true;
|
||||
}
|
||||
|
||||
if (ret || !m_interactive)
|
||||
@@ -801,11 +802,15 @@
|
||||
bgColor[0] = 255;
|
||||
bgColor[1] = 255;
|
||||
bgColor[2] = 255;
|
||||
- SplashOutputDev *dev = new SplashOutputDev(splashModeXBGR8, 4, false, bgColor, true);
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0)
|
||||
+ auto dev = std::make_unique<SplashOutputDev>(splashModeXBGR8, 4, bgColor, true);
|
||||
+#else
|
||||
+ auto dev = std::make_unique<SplashOutputDev>(splashModeXBGR8, 4, false, bgColor, true);
|
||||
+#endif
|
||||
dev->setVectorAntialias(true);
|
||||
dev->setFreeTypeHinting(true, false);
|
||||
dev->startDoc(m_pdfDoc);
|
||||
- m_pdfDoc->displayPage(dev, pgNum, hDPI, vDPI, 0, true, false, false);
|
||||
+ m_pdfDoc->displayPage(dev.get(), pgNum, hDPI, vDPI, 0, true, false, false);
|
||||
SplashBitmap *bitmap = dev->getBitmap();
|
||||
int bw = bitmap->getWidth();
|
||||
int bh = bitmap->getHeight();
|
||||
@@ -843,7 +848,6 @@
|
||||
pp.drawRect(cRect);
|
||||
pp.end();
|
||||
}
|
||||
- delete dev;
|
||||
return image;
|
||||
}
|
||||
|
||||
Index: Scribus/scribus/plugins/import/pdf/pdftextrecognition.cpp
|
||||
===================================================================
|
||||
--- Scribus/scribus/plugins/import/pdf/pdftextrecognition.cpp (revision 27386)
|
||||
+++ Scribus/scribus/plugins/import/pdf/pdftextrecognition.cpp (revision 27389)
|
||||
@@ -81,7 +81,7 @@
|
||||
*/
|
||||
PdfGlyph PdfTextRecognition::AddCharCommon(GfxState* state, double x, double y, double dx, double dy, Unicode const* u, int uLen)
|
||||
{
|
||||
- const double * ctm = state->getCTM();
|
||||
+ const auto ctm = state->getCTM();
|
||||
QTransform trans(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
|
||||
QPointF charDelta1 = trans.map(QPointF(0.0, 0.0));
|
||||
QPointF charDelta2 = trans.map(QPointF(dx, dy));
|
||||
@@ -121,7 +121,7 @@
|
||||
setCharMode(AddCharMode::ADDBASICCHAR);
|
||||
|
||||
//only need to be called for the very first point
|
||||
- const double * ctm = state->getCTM();
|
||||
+ const auto ctm = state->getCTM();
|
||||
QTransform trans(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
|
||||
QPointF glyphPos = trans.map(QPointF(x, y));
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
*/
|
||||
PdfGlyph PdfTextRecognition::AddBasicChar(GfxState* state, double x, double y, double dx, double dy, double originX, double originY, CharCode code, int nBytes, Unicode const* u, int uLen)
|
||||
{
|
||||
- const double * ctm = state->getCTM();
|
||||
+ const auto ctm = state->getCTM();
|
||||
QTransform trans(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
|
||||
|
||||
PdfGlyph newGlyph = AddCharCommon(state, x, y, dx, dy, u, uLen);
|
||||
@@ -461,7 +461,7 @@
|
||||
*/
|
||||
void PdfTextOutputDev::updateTextPos(GfxState* state)
|
||||
{
|
||||
- const double * ctm = state->getCTM();
|
||||
+ const auto ctm = state->getCTM();
|
||||
QTransform trans(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
|
||||
|
||||
QPointF newPosition = trans.map(QPointF(state->getCurX(), state->getCurY()));
|
||||
Index: Scribus/scribus/plugins/import/pdf/slaoutput.cpp
|
||||
===================================================================
|
||||
--- Scribus/scribus/plugins/import/pdf/slaoutput.cpp (revision 27386)
|
||||
+++ Scribus/scribus/plugins/import/pdf/slaoutput.cpp (revision 27389)
|
||||
@@ -1535,7 +1535,7 @@
|
||||
|
||||
void SlaOutputDev::adjustClip(GfxState *state, Qt::FillRule fillRule)
|
||||
{
|
||||
- const double *ctm = state->getCTM();
|
||||
+ const auto ctm = state->getCTM();
|
||||
m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
|
||||
QString output = convertPath(state->getPath());
|
||||
if (output.isEmpty())
|
||||
@@ -1563,7 +1563,7 @@
|
||||
void SlaOutputDev::stroke(GfxState *state)
|
||||
{
|
||||
// qDebug() << "Stroke";
|
||||
- const double *ctm = state->getCTM();
|
||||
+ const auto ctm = state->getCTM();
|
||||
m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
|
||||
double xCoor = m_doc->currentPage()->xOffset();
|
||||
double yCoor = m_doc->currentPage()->yOffset();
|
||||
@@ -1671,8 +1671,7 @@
|
||||
|
||||
void SlaOutputDev::createFillItem(GfxState *state, Qt::FillRule fillRule)
|
||||
{
|
||||
- const double *ctm;
|
||||
- ctm = state->getCTM();
|
||||
+ const auto ctm = state->getCTM();
|
||||
m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
|
||||
double xCoor = m_doc->currentPage()->xOffset();
|
||||
double yCoor = m_doc->currentPage()->yOffset();
|
||||
@@ -1799,7 +1798,7 @@
|
||||
out = intersection(m_graphicStack.top().clipPath, out);
|
||||
crect = out.boundingRect();
|
||||
}
|
||||
- const double *ctm = state->getCTM();
|
||||
+ const auto ctm = state->getCTM();
|
||||
m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
|
||||
FPointArray gr;
|
||||
gr.addPoint(GrStartX, GrStartY);
|
||||
@@ -1938,7 +1937,7 @@
|
||||
double GrFocalY = y1;
|
||||
GrEndX = GrFocalX + r1;
|
||||
GrEndY = GrFocalY;
|
||||
- const double *ctm = state->getCTM();
|
||||
+ const auto ctm = state->getCTM();
|
||||
m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
|
||||
FPointArray gr;
|
||||
gr.addPoint(GrStartX, GrStartY);
|
||||
@@ -2023,7 +2022,7 @@
|
||||
output += QString("Z");
|
||||
m_pathIsClosed = true;
|
||||
m_coords = output;
|
||||
- const double *ctm = state->getCTM();
|
||||
+ const auto ctm = state->getCTM();
|
||||
m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
|
||||
const auto& graphicState = m_graphicStack.top();
|
||||
int z = m_doc->itemAdd(PageItem::Polygon, PageItem::Rectangle, xCoor + crect.x(), yCoor + crect.y(), crect.width(), crect.height(), 0, graphicState.fillColor, CommonStrings::None);
|
||||
@@ -2104,7 +2103,7 @@
|
||||
output += QString("Z");
|
||||
m_pathIsClosed = true;
|
||||
m_coords = output;
|
||||
- const double *ctm = state->getCTM();
|
||||
+ const auto ctm = state->getCTM();
|
||||
m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
|
||||
const auto& graphicState = m_graphicStack.top();
|
||||
int z = m_doc->itemAdd(PageItem::Polygon, PageItem::Rectangle, xCoor + crect.x(), yCoor + crect.y(), crect.width(), crect.height(), 0, graphicState.fillColor, CommonStrings::None);
|
||||
@@ -2265,7 +2264,7 @@
|
||||
box.x2 = bbox[2];
|
||||
box.y2 = bbox[3];
|
||||
|
||||
- const double *ctm = state->getCTM();
|
||||
+ const auto ctm = state->getCTM();
|
||||
m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
|
||||
QTransform mm(mat[0], mat[1], mat[2], mat[3], mat[4], mat[5]);
|
||||
QTransform mmx = mm * m_ctm;
|
||||
@@ -2712,7 +2711,7 @@
|
||||
void SlaOutputDev::createImageFrame(QImage& image, GfxState *state, int numColorComponents)
|
||||
{
|
||||
// qDebug() << "SlaOutputDev::createImageFrame";
|
||||
- const double *ctm = state->getCTM();
|
||||
+ const auto ctm = state->getCTM();
|
||||
double xCoor = m_doc->currentPage()->xOffset();
|
||||
double yCoor = m_doc->currentPage()->yOffset();
|
||||
|
||||
@@ -3002,8 +3001,16 @@
|
||||
#else
|
||||
SlaOutFontFileID *id;
|
||||
#endif
|
||||
- SplashFontFile *fontFile;
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0)
|
||||
+ std::shared_ptr<SplashFontFile> fontFile;
|
||||
+#else
|
||||
+ SplashFontFile *fontFile = nullptr;
|
||||
+#endif
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0)
|
||||
+ std::unique_ptr<SplashFontSrc> fontsrc;
|
||||
+#else
|
||||
SplashFontSrc *fontsrc = nullptr;
|
||||
+#endif
|
||||
Object refObj, strObj;
|
||||
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 2, 0)
|
||||
std::vector<int> codeToGID;
|
||||
@@ -3010,7 +3017,11 @@
|
||||
#else
|
||||
int *codeToGID = nullptr;
|
||||
#endif
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0)
|
||||
+ std::array<double, 6> textMat;
|
||||
+#else
|
||||
const double *textMat = nullptr;
|
||||
+#endif
|
||||
double m11, m12, m21, m22, fontSize;
|
||||
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 1, 0)
|
||||
std::array<SplashCoord, 4> mat = { 1.0, 0.0, 0.0, 1.0 };
|
||||
@@ -3070,16 +3081,29 @@
|
||||
fontType = fontLoc->fontType;
|
||||
}
|
||||
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0)
|
||||
+ if (!fileName.empty())
|
||||
+ fontsrc = std::make_unique<SplashFontSrc>(fileName);
|
||||
+ else
|
||||
+ fontsrc = std::make_unique<SplashFontSrc>(std::move(tmpBuf.value()));
|
||||
+#else
|
||||
fontsrc = new SplashFontSrc;
|
||||
if (!fileName.empty())
|
||||
fontsrc->setFile(fileName);
|
||||
else
|
||||
fontsrc->setBuf(std::move(tmpBuf.value()));
|
||||
+#endif
|
||||
|
||||
// load the font file
|
||||
switch (fontType) {
|
||||
case fontType1:
|
||||
-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(24, 11, 0)
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0)
|
||||
+ if (!(fontFile = m_fontEngine->loadType1Font(std::move(id), std::move(fontsrc), (const char**) ((Gfx8BitFont*) gfxFont)->getEncoding(), fontLoc->fontNum)))
|
||||
+ {
|
||||
+ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)");
|
||||
+ goto err2;
|
||||
+ }
|
||||
+#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(24, 11, 0)
|
||||
if (!(fontFile = m_fontEngine->loadType1Font(std::move(id), fontsrc, (const char**) ((Gfx8BitFont*) gfxFont)->getEncoding(), fontLoc->fontNum)))
|
||||
{
|
||||
error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)");
|
||||
@@ -3094,7 +3118,13 @@
|
||||
#endif
|
||||
break;
|
||||
case fontType1C:
|
||||
-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(24, 11, 0)
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0)
|
||||
+ if (!(fontFile = m_fontEngine->loadType1CFont(std::move(id), std::move(fontsrc), (const char**) ((Gfx8BitFont*) gfxFont)->getEncoding(), fontLoc->fontNum)))
|
||||
+ {
|
||||
+ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)");
|
||||
+ goto err2;
|
||||
+ }
|
||||
+#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(24, 11, 0)
|
||||
if (!(fontFile = m_fontEngine->loadType1CFont(std::move(id), fontsrc, (const char**) ((Gfx8BitFont*) gfxFont)->getEncoding(), fontLoc->fontNum)))
|
||||
{
|
||||
error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)");
|
||||
@@ -3109,7 +3139,13 @@
|
||||
#endif
|
||||
break;
|
||||
case fontType1COT:
|
||||
-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(24, 11, 0)
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0)
|
||||
+ if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(std::move(id), std::move(fontsrc), (const char**) ((Gfx8BitFont*) gfxFont)->getEncoding(), fontLoc->fontNum)))
|
||||
+ {
|
||||
+ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)");
|
||||
+ goto err2;
|
||||
+ }
|
||||
+#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(24, 11, 0)
|
||||
if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(std::move(id), fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding(), fontLoc->fontNum)))
|
||||
{
|
||||
error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)");
|
||||
@@ -3125,10 +3161,15 @@
|
||||
break;
|
||||
case fontTrueType:
|
||||
case fontTrueTypeOT:
|
||||
-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 7, 0)
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0)
|
||||
if (!fileName.empty())
|
||||
ff = FoFiTrueType::load(fileName.c_str(), fontLoc->fontNum);
|
||||
else
|
||||
+ ff = FoFiTrueType::make(fontsrc->buf(), fontLoc->fontNum);
|
||||
+#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 7, 0)
|
||||
+ if (!fileName.empty())
|
||||
+ ff = FoFiTrueType::load(fileName.c_str(), fontLoc->fontNum);
|
||||
+ else
|
||||
ff = FoFiTrueType::make(fontsrc->buf, fontLoc->fontNum);
|
||||
#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(24, 11, 0)
|
||||
if (!fileName.empty())
|
||||
@@ -3156,7 +3197,13 @@
|
||||
#endif
|
||||
n = 0;
|
||||
}
|
||||
-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 2, 0)
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0)
|
||||
+ if (!(fontFile = m_fontEngine->loadTrueTypeFont(std::move(id), std::move(fontsrc), std::move(codeToGID), fontLoc->fontNum)))
|
||||
+ {
|
||||
+ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)");
|
||||
+ goto err2;
|
||||
+ }
|
||||
+#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 2, 0)
|
||||
if (!(fontFile = m_fontEngine->loadTrueTypeFont(std::move(id), fontsrc, std::move(codeToGID), fontLoc->fontNum)))
|
||||
{
|
||||
error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)");
|
||||
@@ -3178,7 +3225,13 @@
|
||||
break;
|
||||
case fontCIDType0:
|
||||
case fontCIDType0C:
|
||||
-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(24, 11, 0)
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0)
|
||||
+ if (!(fontFile = m_fontEngine->loadCIDFont(std::move(id), std::move(fontsrc), fontLoc->fontNum)))
|
||||
+ {
|
||||
+ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)");
|
||||
+ goto err2;
|
||||
+ }
|
||||
+#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(24, 11, 0)
|
||||
if (!(fontFile = m_fontEngine->loadCIDFont(std::move(id), fontsrc, fontLoc->fontNum)))
|
||||
{
|
||||
error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)");
|
||||
@@ -3217,7 +3270,14 @@
|
||||
n = 0;
|
||||
}
|
||||
#endif
|
||||
-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 2, 0)
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0)
|
||||
+ if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(std::move(id), std::move(fontsrc), std::move(codeToGID), fontLoc->fontNum)))
|
||||
+ {
|
||||
+ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
|
||||
+ gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)");
|
||||
+ goto err2;
|
||||
+ }
|
||||
+#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 2, 0)
|
||||
if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(std::move(id), fontsrc, std::move(codeToGID), fontLoc->fontNum)))
|
||||
{
|
||||
error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
|
||||
@@ -3265,10 +3325,15 @@
|
||||
#endif
|
||||
else
|
||||
{
|
||||
-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 7, 0)
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0)
|
||||
if (!fileName.empty())
|
||||
ff = FoFiTrueType::load(fileName.c_str(), fontLoc->fontNum);
|
||||
else
|
||||
+ ff = FoFiTrueType::make(fontsrc->buf(), fontLoc->fontNum);
|
||||
+#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 7, 0)
|
||||
+ if (!fileName.empty())
|
||||
+ ff = FoFiTrueType::load(fileName.c_str(), fontLoc->fontNum);
|
||||
+ else
|
||||
ff = FoFiTrueType::make(fontsrc->buf, fontLoc->fontNum);
|
||||
#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(24, 11, 0)
|
||||
if (!fileName.empty())
|
||||
@@ -3290,7 +3355,13 @@
|
||||
#endif
|
||||
ff.reset();
|
||||
}
|
||||
-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 2, 0)
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0)
|
||||
+ if (!(fontFile = m_fontEngine->loadTrueTypeFont(std::move(id), std::move(fontsrc), std::move(codeToGID), fontLoc->fontNum)))
|
||||
+ {
|
||||
+ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)");
|
||||
+ goto err2;
|
||||
+ }
|
||||
+#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 2, 0)
|
||||
if (!(fontFile = m_fontEngine->loadTrueTypeFont(std::move(id), fontsrc, std::move(codeToGID), fontLoc->fontNum)))
|
||||
{
|
||||
error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)");
|
||||
@@ -3335,8 +3406,10 @@
|
||||
mat[3] = -m22;
|
||||
m_font = m_fontEngine->getFont(fontFile, mat, matrix);
|
||||
|
||||
+#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(26, 2, 0)
|
||||
if (fontsrc && !fontsrc->isFile)
|
||||
fontsrc->unref();
|
||||
+#endif
|
||||
return;
|
||||
|
||||
err2:
|
||||
@@ -3347,8 +3420,12 @@
|
||||
#endif
|
||||
|
||||
err1:
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0)
|
||||
+ fontsrc.reset();
|
||||
+#else
|
||||
if (fontsrc && !fontsrc->isFile)
|
||||
fontsrc->unref();
|
||||
+#endif
|
||||
}
|
||||
|
||||
void SlaOutputDev::drawChar(GfxState* state, double x, double y, double dx, double dy, double originX, double originY, CharCode code, int nBytes, const Unicode* u, int uLen)
|
||||
@@ -3402,7 +3479,7 @@
|
||||
if (f & splashPathLast)
|
||||
qPath.closeSubpath();
|
||||
}
|
||||
- const double * ctm = state->getCTM();
|
||||
+ const auto ctm = state->getCTM();
|
||||
m_ctm = QTransform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
|
||||
double xCoor = m_doc->currentPage()->xOffset();
|
||||
double yCoor = m_doc->currentPage()->yOffset();
|
||||
@@ -58,15 +58,8 @@
|
||||
<Dependency>libfreehand-devel</Dependency>
|
||||
</BuildDependencies>
|
||||
<Patches>
|
||||
<!-- <Patch>scribus-1.5.3-fpic.patch</Patch> -->
|
||||
<!-- <Patch>85c0dff3422f.patch</Patch> -->
|
||||
<!-- <Patch>f75c1613db67.patch</Patch> -->
|
||||
<!-- <Patch>f19410ac3b27.patch</Patch> -->
|
||||
<!-- <Patch>f2237b8f0b5c.patch</Patch> -->
|
||||
<!-- <Patch>scribus-1.5.8-poppler-22.09.0.patch</Patch> -->
|
||||
<Patch>gentoo/scribus-1.5.8-cmake.patch</Patch>
|
||||
<!-- <Patch>fix_build_with_poppler_26.01.0.patch</Patch> -->
|
||||
<!-- <Patch>poppler-26.02.patch</Patch> -->
|
||||
<Patch>14a287fc1db2a44abfe1743260554447b31b4adf.patch</Patch>
|
||||
</Patches>
|
||||
</Source>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user