mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-18 00:10:04 +00:00
print/scribus-devel: update 1.5.8 → 1.6.2 (copy of print/scribus)
* 1.5.8 is outdated development version, older than the stable version; * the port is almost broken (silent grab, incorrect dependency list); * the next development branch 1.7 has no releases yet; * keep the port for upcoming releases from the 1.7 branch. Approved by: pkubaj (maintainer, via IRC) MFH: 2024Q3
This commit is contained in:
parent
26eecc68d5
commit
9f6409c376
@ -1,6 +1,5 @@
|
||||
PORTNAME= scribus
|
||||
PORTVERSION= 1.5.8
|
||||
PORTREVISION= 26
|
||||
DISTVERSION= 1.6.2
|
||||
CATEGORIES= print editors
|
||||
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}${PKGNAMESUFFIX}/${PORTVERSION}/ \
|
||||
http://www.scribus.net/downloads/${PORTVERSION}/
|
||||
@ -14,12 +13,8 @@ LICENSE= GPLv2+
|
||||
LICENSE_FILE= ${WRKSRC}/COPYING
|
||||
|
||||
LIB_DEPENDS= liblcms2.so:graphics/lcms2 \
|
||||
libboost_thread.so:devel/boost-libs \
|
||||
libhunspell-1.7.so:textproc/hunspell \
|
||||
libcairo.so:graphics/cairo \
|
||||
librevenge-0.0.so:textproc/librevenge \
|
||||
libcups.so:print/cups \
|
||||
libwpg-0.3.so:graphics/libwpg03 \
|
||||
libcdr-0.1.so:graphics/libcdr01 \
|
||||
libfreehand-0.1.so:graphics/libfreehand \
|
||||
libpagemaker-0.0.so:print/libpagemaker \
|
||||
@ -30,45 +25,48 @@ LIB_DEPENDS= liblcms2.so:graphics/lcms2 \
|
||||
libpoppler.so:graphics/poppler \
|
||||
libharfbuzz-icu.so:print/harfbuzz-icu \
|
||||
libfontconfig.so:x11-fonts/fontconfig \
|
||||
libpodofo09.so:graphics/podofo09 \
|
||||
libharfbuzz.so:print/harfbuzz \
|
||||
libpng.so:graphics/png \
|
||||
libicuuc.so:devel/icu \
|
||||
libqxp-0.0.so:textproc/libqxp \
|
||||
libzmf-0.0.so:graphics/libzmf
|
||||
|
||||
USES= cmake compiler:c++17-lang desktop-file-utils dos2unix gnome \
|
||||
jpeg pkgconfig python qt:5 shared-mime-info tar:xz
|
||||
USE_QT= buildtools:build core declarative gui linguisttools:build \
|
||||
network opengl printsupport qmake:build widgets xml
|
||||
DOS2UNIX_REGEX= .*\.(cpp|h|txt)
|
||||
USE_GNOME= libxml2
|
||||
USES= cmake compiler:c++17-lang desktop-file-utils gnome jpeg \
|
||||
pkgconfig python qt:5 shared-mime-info tar:xz
|
||||
USE_QT= buildtools:build core gui linguisttools:build network opengl \
|
||||
printsupport qmake:build widgets xml
|
||||
USE_GNOME= cairo libxml2
|
||||
|
||||
CMAKE_ARGS+= -DWANT_HUNSPELL=YES \
|
||||
-DWANT_CPP17=YES \
|
||||
-DCMAKE_COLOR_MAKEFILE:BOOL=ON
|
||||
CMAKE_ARGS= -DWANT_CPP17=YES
|
||||
|
||||
CONFLICTS_INSTALL= scribus
|
||||
|
||||
OPTIONS_DEFINE= DOCS
|
||||
OPTIONS_DEFINE= BOOST DOCS GRAPHICSMAGICK HUNSPELL OSG PDF
|
||||
OPTIONS_DEFAULT=BOOST GRAPHICSMAGICK HUNSPELL OSG PDF
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
BOOST_DESC= Enable support for Boost-based enhancement
|
||||
GRAPHICSMAGICK_DESC= Use GraphicsMagick for image import support
|
||||
HUNSPELL_DESC= Enable spellchecking via hunspell
|
||||
OSG_DESC= Enable 3D rendering via osg
|
||||
PDF_DESC= Enable PDF export via podofo
|
||||
|
||||
# Patch sources to force using include files installed by graphics/podofo09
|
||||
post-patch:
|
||||
@${REINPLACE_CMD} -e '/^[\t ]*#include/s|podofo/podofo.h|podofo09/podofo.h|' \
|
||||
${WRKSRC}/scribus/plugins/import/ps/importps.cpp \
|
||||
${WRKSRC}/scribus/plugins/import/ai/importai.cpp \
|
||||
${WRKSRC}/scribus/imagedataloaders/scimgdataloader_pdf.cpp \
|
||||
${WRKSRC}/scribus/pdflib_core.h \
|
||||
${WRKSRC}/scribus/pdf_analyzer.h
|
||||
.if ${COMPILER_TYPE} == clang
|
||||
@${REINPLACE_CMD} -e 's|std::unary_function|std::__unary_function|' \
|
||||
${WRKSRC}/scribus/desaxe/digester.cpp
|
||||
.endif
|
||||
BOOST_BUILD_DEPENDS= boost-libs>0:devel/boost-libs
|
||||
BOOST_CMAKE_BOOL= WITH_BOOST
|
||||
|
||||
GRAPHICSMAGICK_LIB_DEPENDS= libGraphicsMagick.so:graphics/GraphicsMagick
|
||||
GRAPHICSMAGICK_CMAKE_BOOL= WANT_GRAPHICSMAGICK
|
||||
|
||||
HUNSPELL_LIB_DEPENDS= libhunspell-1.7.so:textproc/hunspell
|
||||
HUNSPELL_CMAKE_BOOL= WANT_HUNSPELL
|
||||
|
||||
OSG_LIB_DEPENDS= libosg.so:graphics/osg
|
||||
OSG_CMAKE_BOOL_OFF= WANT_NOOSG
|
||||
|
||||
PDF_LIB_DEPENDS= libpodofo.so:graphics/podofo
|
||||
PDF_CMAKE_BOOL= WITH_PODOFO
|
||||
|
||||
post-install:
|
||||
${LN} -sf ../share/icons/1_5_1/scribus.png \
|
||||
${LN} -sf ../scribus/icons/1_5_1/scribus.png \
|
||||
${STAGEDIR}${PREFIX}/share/pixmaps/
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
.include <bsd.port.mk>
|
||||
|
@ -1,3 +1,3 @@
|
||||
TIMESTAMP = 1643023155
|
||||
SHA256 (scribus-1.5.8.tar.xz) = 47816e8fcf6d05788ff16aa4499f97ff22431c777a7789149b0a88b451e16b74
|
||||
SIZE (scribus-1.5.8.tar.xz) = 74543476
|
||||
TIMESTAMP = 1718530983
|
||||
SHA256 (scribus-1.6.2.tar.xz) = 7eff9b1f47e372e56bb369f1dbe18fe49101789b5e6bcfdb7890e0346b641383
|
||||
SIZE (scribus-1.6.2.tar.xz) = 73129400
|
||||
|
@ -1,48 +0,0 @@
|
||||
--- cmake/modules/FindLIBPODOFO.cmake.orig 2022-01-23 16:16:42 UTC
|
||||
+++ cmake/modules/FindLIBPODOFO.cmake
|
||||
@@ -13,7 +13,7 @@ find_path(LIBPODOFO_INCLUDE_DIR
|
||||
endif(WIN32)
|
||||
|
||||
find_path(LIBPODOFO_INCLUDE_DIR
|
||||
- NAMES podofo/podofo.h
|
||||
+ NAMES podofo09/podofo.h
|
||||
PATHS
|
||||
"${LIBPODOFO_DIR}/include"
|
||||
"${LIBPODOFO_DIR}/src"
|
||||
@@ -23,7 +23,7 @@ find_library(LIBPODOFO_LIBRARY
|
||||
set(LIBPODOFO_FIND_QUIETLY ON)
|
||||
|
||||
find_library(LIBPODOFO_LIBRARY
|
||||
- NAMES libpodofo podofo
|
||||
+ NAMES libpodofo09 podofo09
|
||||
PATHS
|
||||
"${LIBPODOFO_DIR}/lib"
|
||||
"${LIBPODOFO_DIR}/src"
|
||||
@@ -32,7 +32,7 @@ if(LIBPODOFO_INCLUDE_DIR AND LIBPODOFO_LIBRARY)
|
||||
|
||||
if(LIBPODOFO_INCLUDE_DIR AND LIBPODOFO_LIBRARY)
|
||||
if(NOT LIBPODOFO_CONFIG_H)
|
||||
- set(LIBPODOFO_CONFIG_H "${LIBPODOFO_INCLUDE_DIR}/podofo/base/podofo_config.h" CACHE FILEPATH "Alternative place of podofo_config.h")
|
||||
+ set(LIBPODOFO_CONFIG_H "${LIBPODOFO_INCLUDE_DIR}/podofo09/base/podofo_config.h" CACHE FILEPATH "Alternative place of podofo_config.h")
|
||||
endif()
|
||||
|
||||
file(STRINGS "${LIBPODOFO_CONFIG_H}" PODOFO_MAJOR_VER_LINE REGEX "^#define[ \t]+PODOFO_VERSION_MAJOR[ \t]+[0-9]+$")
|
||||
@@ -69,14 +69,14 @@ if(NOT LIBPODOFO_FIND_QUIETLY)
|
||||
|
||||
if(NOT LIBPODOFO_FIND_QUIETLY)
|
||||
if(LIBPODOFO_INCLUDE_DIR)
|
||||
- message("podofo/podofo.h: ${LIBPODOFO_INCLUDE_DIR}")
|
||||
+ message("podofo09/podofo.h: ${LIBPODOFO_INCLUDE_DIR}")
|
||||
else(LIBPODOFO_INCLUDE_DIR)
|
||||
- message("podofo/podofo.h: not found")
|
||||
+ message("podofo09/podofo.h: not found")
|
||||
endif(LIBPODOFO_INCLUDE_DIR)
|
||||
if(LIBPODOFO_LIBRARY)
|
||||
- message("podofo lib: ${LIBPODOFO_LIBRARY}")
|
||||
+ message("podofo09 lib: ${LIBPODOFO_LIBRARY}")
|
||||
else(LIBPODOFO_LIBRARY)
|
||||
- message("podofo lib: not found")
|
||||
+ message("podofo09 lib: not found")
|
||||
endif(LIBPODOFO_LIBRARY)
|
||||
message("PoDoFo cflags: ${useshared}")
|
||||
endif(NOT LIBPODOFO_FIND_QUIETLY)
|
@ -1,119 +0,0 @@
|
||||
diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
|
||||
index 5894bf2ad6..3650c96f52 100644
|
||||
--- scribus/plugins/import/pdf/slaoutput.cpp
|
||||
+++ scribus/plugins/import/pdf/slaoutput.cpp
|
||||
@@ -7,6 +7,11 @@ for which a new license (GPL+exception) is in place.
|
||||
|
||||
#include "slaoutput.h"
|
||||
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
|
||||
+#include <memory>
|
||||
+#include <optional>
|
||||
+#endif
|
||||
+
|
||||
#include <poppler/GlobalParams.h>
|
||||
#include <poppler/poppler-config.h>
|
||||
#include <poppler/FileSpec.h>
|
||||
@@ -3027,18 +3032,24 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
|
||||
void SlaOutputDev::updateFont(GfxState *state)
|
||||
{
|
||||
GfxFont *gfxFont;
|
||||
- GfxFontLoc *fontLoc;
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
|
||||
+ std::optional<GfxFontLoc> fontLoc;
|
||||
+ const GooString * fileName = nullptr;
|
||||
+ std::unique_ptr<FoFiTrueType> ff;
|
||||
+#else
|
||||
+ GfxFontLoc * fontLoc = nullptr;
|
||||
+ GooString * fileName = nullptr;
|
||||
+ FoFiTrueType * ff = nullptr;
|
||||
+#endif
|
||||
GfxFontType fontType;
|
||||
SlaOutFontFileID *id;
|
||||
SplashFontFile *fontFile;
|
||||
SplashFontSrc *fontsrc = nullptr;
|
||||
- FoFiTrueType *ff;
|
||||
Object refObj, strObj;
|
||||
- GooString *fileName;
|
||||
- char *tmpBuf;
|
||||
+ char *tmpBuf = nullptr;
|
||||
int tmpBufLen = 0;
|
||||
- int *codeToGID;
|
||||
- const double *textMat;
|
||||
+ int *codeToGID = nullptr;
|
||||
+ const double *textMat = nullptr;
|
||||
double m11, m12, m21, m22, fontSize;
|
||||
SplashCoord mat[4];
|
||||
int n = 0;
|
||||
@@ -3046,9 +3057,6 @@ void SlaOutputDev::updateFont(GfxState *state)
|
||||
SplashCoord matrix[6];
|
||||
|
||||
m_font = nullptr;
|
||||
- fileName = nullptr;
|
||||
- tmpBuf = nullptr;
|
||||
- fontLoc = nullptr;
|
||||
|
||||
gfxFont = state->getFont();
|
||||
if (!gfxFont)
|
||||
@@ -3083,7 +3091,11 @@ void SlaOutputDev::updateFont(GfxState *state)
|
||||
}
|
||||
else
|
||||
{ // gfxFontLocExternal
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
|
||||
+ fileName = fontLoc->pathAsGooString();
|
||||
+#else
|
||||
fileName = fontLoc->path;
|
||||
+#endif
|
||||
fontType = fontLoc->fontType;
|
||||
}
|
||||
|
||||
@@ -3136,9 +3148,14 @@ void SlaOutputDev::updateFont(GfxState *state)
|
||||
ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
|
||||
if (ff)
|
||||
{
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
|
||||
+ codeToGID = ((Gfx8BitFont*) gfxFont)->getCodeToGIDMap(ff.get());
|
||||
+ ff.reset();
|
||||
+#else
|
||||
codeToGID = ((Gfx8BitFont *)gfxFont)->getCodeToGIDMap(ff);
|
||||
- n = 256;
|
||||
delete ff;
|
||||
+#endif
|
||||
+ n = 256;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3209,8 +3226,13 @@ void SlaOutputDev::updateFont(GfxState *state)
|
||||
ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
|
||||
if (! ff)
|
||||
goto err2;
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
|
||||
+ codeToGID = ((GfxCIDFont*) gfxFont)->getCodeToGIDMap(ff.get(), &n);
|
||||
+ ff.reset();
|
||||
+#else
|
||||
codeToGID = ((GfxCIDFont *)gfxFont)->getCodeToGIDMap(ff, &n);
|
||||
delete ff;
|
||||
+#endif
|
||||
}
|
||||
if (!(fontFile = m_fontEngine->loadTrueTypeFont(
|
||||
id,
|
||||
@@ -3247,14 +3269,19 @@ void SlaOutputDev::updateFont(GfxState *state)
|
||||
mat[3] = -m22;
|
||||
m_font = m_fontEngine->getFont(fontFile, mat, matrix);
|
||||
|
||||
+#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
|
||||
delete fontLoc;
|
||||
+#endif
|
||||
if (fontsrc && !fontsrc->isFile)
|
||||
fontsrc->unref();
|
||||
return;
|
||||
|
||||
err2:
|
||||
delete id;
|
||||
+#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(22, 2, 0)
|
||||
delete fontLoc;
|
||||
+#endif
|
||||
+
|
||||
err1:
|
||||
if (fontsrc && !fontsrc->isFile)
|
||||
fontsrc->unref();
|
@ -1,18 +0,0 @@
|
||||
diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
|
||||
index 3650c96f52..a6f4e00fa9 100644
|
||||
--- scribus/plugins/import/pdf/slaoutput.cpp
|
||||
+++ scribus/plugins/import/pdf/slaoutput.cpp
|
||||
@@ -3072,10 +3072,10 @@ void SlaOutputDev::updateFont(GfxState *state)
|
||||
delete id;
|
||||
else
|
||||
{
|
||||
- if (!(fontLoc = gfxFont->locateFont(xref, nullptr)))
|
||||
+ fontLoc = gfxFont->locateFont((xref) ? xref : pdfDoc->getXRef(), nullptr);
|
||||
+ if (!fontLoc)
|
||||
{
|
||||
- error(errSyntaxError, -1, "Couldn't find a font for '{0:s}'",
|
||||
- gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
|
||||
+ error(errSyntaxError, -1, "Couldn't find a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
|
||||
goto err2;
|
||||
}
|
||||
|
@ -1,42 +0,0 @@
|
||||
diff --git a/scribus/plugins/import/pdf/importpdf.cpp b/scribus/plugins/import/pdf/importpdf.cpp
|
||||
index 154e58a3f0..392dcd9e64 100644
|
||||
--- scribus/plugins/import/pdf/importpdf.cpp
|
||||
+++ scribus/plugins/import/pdf/importpdf.cpp
|
||||
@@ -89,7 +89,11 @@ QImage PdfPlug::readThumbnail(const QString& fName)
|
||||
#endif
|
||||
globalParams->setErrQuiet(gTrue);
|
||||
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
|
||||
+ PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
|
||||
+#else
|
||||
PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
|
||||
+#endif
|
||||
if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
|
||||
return QImage();
|
||||
|
||||
@@ -342,7 +346,11 @@ bool PdfPlug::convert(const QString& fn)
|
||||
globalParams->setErrQuiet(gTrue);
|
||||
// globalParams->setPrintCommands(gTrue);
|
||||
QList<OptionalContentGroup*> ocgGroups;
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
|
||||
+ auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
|
||||
+#else
|
||||
auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
|
||||
+#endif
|
||||
if (pdfDoc)
|
||||
{
|
||||
if (pdfDoc->getErrorCode() == errEncrypted)
|
||||
@@ -361,8 +369,13 @@ bool PdfPlug::convert(const QString& fn)
|
||||
#else
|
||||
auto fname = new GooString(QFile::encodeName(fn).data());
|
||||
#endif
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
|
||||
+ std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
|
||||
+ pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
|
||||
+#else
|
||||
auto userPW = new GooString(text.toLocal8Bit().data());
|
||||
pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
|
||||
+#endif
|
||||
qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
|
||||
}
|
||||
if ((!pdfDoc) || (pdfDoc->getErrorCode() != errNone))
|
@ -1,278 +0,0 @@
|
||||
diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp
|
||||
index e20a81f99e..5626fe3477 100644
|
||||
--- scribus/plugins/import/pdf/slaoutput.cpp
|
||||
+++ scribus/plugins/import/pdf/slaoutput.cpp
|
||||
@@ -174,8 +174,13 @@ void AnoOutputDev::drawString(GfxState *state, POPPLER_CONST GooString *s)
|
||||
int shade = 100;
|
||||
currColorText = getColor(state->getFillColorSpace(), state->getFillColor(), &shade);
|
||||
fontSize = state->getFontSize();
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
|
||||
+ if (state->getFont() && state->getFont()->getName())
|
||||
+ fontName = new GooString(state->getFont()->getName().value());
|
||||
+#else
|
||||
if (state->getFont())
|
||||
fontName = state->getFont()->getName()->copy();
|
||||
+#endif
|
||||
itemText = s->copy();
|
||||
}
|
||||
|
||||
@@ -357,7 +362,12 @@ std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key
|
||||
GBool SlaOutputDev::annotations_callback(Annot *annota, void *user_data)
|
||||
{
|
||||
SlaOutputDev *dev = (SlaOutputDev*)user_data;
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
|
||||
+ const PDFRectangle& annotRect = annota->getRect();;
|
||||
+ const PDFRectangle* box = &annotRect;
|
||||
+#else
|
||||
PDFRectangle *box = annota->getRect();
|
||||
+#endif
|
||||
double xCoor = dev->m_doc->currentPage()->xOffset() + box->x1 - dev->cropOffsetX;
|
||||
double yCoor = dev->m_doc->currentPage()->yOffset() + dev->m_doc->currentPage()->height() - box->y2 + dev->cropOffsetY;
|
||||
double width = box->x2 - box->x1;
|
||||
@@ -684,7 +694,12 @@ bool SlaOutputDev::handleWidgetAnnot(Annot* annota, double xCoor, double yCoor,
|
||||
if (apa || !achar)
|
||||
{
|
||||
AnoOutputDev *annotOutDev = new AnoOutputDev(m_doc, m_importedColors);
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
|
||||
+ const PDFRectangle& annotaRect = annota->getRect();
|
||||
+ Gfx* gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), &annotaRect, nullptr);
|
||||
+#else
|
||||
Gfx *gfx = new Gfx(pdfDoc, annotOutDev, pdfDoc->getPage(m_actPage)->getResourceDict(), annota->getRect(), nullptr);
|
||||
+#endif
|
||||
ano->draw(gfx, false);
|
||||
if (!bgFound)
|
||||
m_currColorFill = annotOutDev->currColorFill;
|
||||
@@ -2916,22 +2931,27 @@ void SlaOutputDev::markPoint(POPPLER_CONST char *name, Dict *properties)
|
||||
|
||||
void SlaOutputDev::updateFont(GfxState *state)
|
||||
{
|
||||
- GfxFont *gfxFont;
|
||||
-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
|
||||
+ std::optional<GfxFontLoc> fontLoc;
|
||||
+ std::string fileName;
|
||||
+ std::unique_ptr<FoFiTrueType> ff;
|
||||
+ std::optional<std::vector<unsigned char>> tmpBuf;
|
||||
+#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
|
||||
std::optional<GfxFontLoc> fontLoc;
|
||||
const GooString * fileName = nullptr;
|
||||
std::unique_ptr<FoFiTrueType> ff;
|
||||
+ char* tmpBuf = nullptr;
|
||||
#else
|
||||
GfxFontLoc * fontLoc = nullptr;
|
||||
GooString * fileName = nullptr;
|
||||
FoFiTrueType * ff = nullptr;
|
||||
+ char* tmpBuf = nullptr;
|
||||
#endif
|
||||
GfxFontType fontType;
|
||||
SlaOutFontFileID *id;
|
||||
SplashFontFile *fontFile;
|
||||
SplashFontSrc *fontsrc = nullptr;
|
||||
Object refObj, strObj;
|
||||
- char *tmpBuf = nullptr;
|
||||
int tmpBufLen = 0;
|
||||
int *codeToGID = nullptr;
|
||||
const double *textMat = nullptr;
|
||||
@@ -2943,7 +2963,11 @@ void SlaOutputDev::updateFont(GfxState *state)
|
||||
|
||||
m_font = nullptr;
|
||||
|
||||
- gfxFont = state->getFont();
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
|
||||
+ GfxFont* gfxFont = state->getFont().get();
|
||||
+#else
|
||||
+ GfxFont* gfxFont = state->getFont();
|
||||
+#endif
|
||||
if (!gfxFont)
|
||||
goto err1;
|
||||
|
||||
@@ -2968,15 +2992,23 @@ void SlaOutputDev::updateFont(GfxState *state)
|
||||
if (fontLoc->locType == gfxFontLocEmbedded)
|
||||
{
|
||||
// if there is an embedded font, read it to memory
|
||||
- tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
|
||||
+ tmpBuf = gfxFont->readEmbFontFile((xref) ? xref : pdfDoc->getXRef());
|
||||
if (! tmpBuf)
|
||||
goto err2;
|
||||
+#else
|
||||
+ tmpBuf = gfxFont->readEmbFontFile(xref, &tmpBufLen);
|
||||
+ if (!tmpBuf)
|
||||
+ goto err2;
|
||||
+#endif
|
||||
|
||||
// external font
|
||||
}
|
||||
else
|
||||
{ // gfxFontLocExternal
|
||||
-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
|
||||
+ fileName = fontLoc->path;
|
||||
+#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
|
||||
fileName = fontLoc->pathAsGooString();
|
||||
#else
|
||||
fileName = fontLoc->path;
|
||||
@@ -2985,52 +3017,54 @@ void SlaOutputDev::updateFont(GfxState *state)
|
||||
}
|
||||
|
||||
fontsrc = new SplashFontSrc;
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
|
||||
+ if (!fileName.empty())
|
||||
+ fontsrc->setFile(fileName);
|
||||
+ else
|
||||
+ fontsrc->setBuf(std::move(tmpBuf.value()));
|
||||
+#else
|
||||
if (fileName)
|
||||
fontsrc->setFile(fileName, gFalse);
|
||||
else
|
||||
fontsrc->setBuf(tmpBuf, tmpBufLen, gTrue);
|
||||
+#endif
|
||||
|
||||
// load the font file
|
||||
switch (fontType) {
|
||||
case fontType1:
|
||||
- if (!(fontFile = m_fontEngine->loadType1Font(
|
||||
- id,
|
||||
- fontsrc,
|
||||
- (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
|
||||
+ if (!(fontFile = m_fontEngine->loadType1Font(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
|
||||
{
|
||||
- error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
|
||||
- gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
|
||||
+ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
|
||||
goto err2;
|
||||
}
|
||||
break;
|
||||
case fontType1C:
|
||||
- if (!(fontFile = m_fontEngine->loadType1CFont(
|
||||
- id,
|
||||
- fontsrc,
|
||||
- (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
|
||||
+ if (!(fontFile = m_fontEngine->loadType1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
|
||||
{
|
||||
- error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
|
||||
- gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
|
||||
+ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
|
||||
goto err2;
|
||||
}
|
||||
break;
|
||||
case fontType1COT:
|
||||
- if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(
|
||||
- id,
|
||||
- fontsrc,
|
||||
- (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
|
||||
+ if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(id, fontsrc, (const char **)((Gfx8BitFont *) gfxFont)->getEncoding())))
|
||||
{
|
||||
- error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
|
||||
- gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
|
||||
+ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
|
||||
goto err2;
|
||||
}
|
||||
break;
|
||||
case fontTrueType:
|
||||
case fontTrueTypeOT:
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
|
||||
+ if (!fileName.empty())
|
||||
+ ff = FoFiTrueType::load(fileName.c_str());
|
||||
+ else
|
||||
+ ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
|
||||
+#else
|
||||
if (fileName)
|
||||
ff = FoFiTrueType::load(fileName->getCString());
|
||||
else
|
||||
ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
|
||||
+#endif
|
||||
if (ff)
|
||||
{
|
||||
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
|
||||
@@ -3047,24 +3081,17 @@ void SlaOutputDev::updateFont(GfxState *state)
|
||||
codeToGID = nullptr;
|
||||
n = 0;
|
||||
}
|
||||
- if (!(fontFile = m_fontEngine->loadTrueTypeFont(
|
||||
- id,
|
||||
- fontsrc,
|
||||
- codeToGID, n)))
|
||||
+ if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n)))
|
||||
{
|
||||
- error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
|
||||
- gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
|
||||
+ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
|
||||
goto err2;
|
||||
}
|
||||
break;
|
||||
case fontCIDType0:
|
||||
case fontCIDType0C:
|
||||
- if (!(fontFile = m_fontEngine->loadCIDFont(
|
||||
- id,
|
||||
- fontsrc)))
|
||||
+ if (!(fontFile = m_fontEngine->loadCIDFont(id, fontsrc)))
|
||||
{
|
||||
- error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
|
||||
- gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
|
||||
+ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
|
||||
goto err2;
|
||||
}
|
||||
break;
|
||||
@@ -3080,10 +3107,7 @@ void SlaOutputDev::updateFont(GfxState *state)
|
||||
codeToGID = nullptr;
|
||||
n = 0;
|
||||
}
|
||||
- if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(
|
||||
- id,
|
||||
- fontsrc,
|
||||
- codeToGID, n)))
|
||||
+ if (!(fontFile = m_fontEngine->loadOpenTypeCFFFont(id, fontsrc, codeToGID, n)))
|
||||
{
|
||||
error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
|
||||
gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
|
||||
@@ -3105,10 +3129,17 @@ void SlaOutputDev::updateFont(GfxState *state)
|
||||
}
|
||||
else
|
||||
{
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
|
||||
+ if (!fileName.empty())
|
||||
+ ff = FoFiTrueType::load(fileName.c_str());
|
||||
+ else
|
||||
+ ff = FoFiTrueType::make(fontsrc->buf.data(), fontsrc->buf.size());
|
||||
+#else
|
||||
if (fileName)
|
||||
ff = FoFiTrueType::load(fileName->getCString());
|
||||
else
|
||||
ff = FoFiTrueType::make(tmpBuf, tmpBufLen);
|
||||
+#endif
|
||||
if (! ff)
|
||||
goto err2;
|
||||
#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 2, 0)
|
||||
@@ -3119,13 +3150,9 @@ void SlaOutputDev::updateFont(GfxState *state)
|
||||
delete ff;
|
||||
#endif
|
||||
}
|
||||
- if (!(fontFile = m_fontEngine->loadTrueTypeFont(
|
||||
- id,
|
||||
- fontsrc,
|
||||
- codeToGID, n, faceIndex)))
|
||||
+ if (!(fontFile = m_fontEngine->loadTrueTypeFont(id, fontsrc, codeToGID, n, faceIndex)))
|
||||
{
|
||||
- error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'",
|
||||
- gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
|
||||
+ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)");
|
||||
goto err2;
|
||||
}
|
||||
break;
|
||||
@@ -3269,9 +3296,15 @@ void SlaOutputDev::drawChar(GfxState* state, double x, double y, double dx, doub
|
||||
GBool SlaOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, POPPLER_CONST_082 Unicode *u, int uLen)
|
||||
{
|
||||
// qDebug() << "beginType3Char";
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 4, 0)
|
||||
GfxFont *gfxFont;
|
||||
+ if (!(gfxFont = state->getFont().get()))
|
||||
+ return gTrue;
|
||||
+#else
|
||||
+ GfxFont* gfxFont;
|
||||
if (!(gfxFont = state->getFont()))
|
||||
return gTrue;
|
||||
+#endif
|
||||
if (gfxFont->getType() != fontType3)
|
||||
return gTrue;
|
||||
F3Entry f3e;
|
@ -1,23 +0,0 @@
|
||||
Obtained from:
|
||||
https://github.com/archlinux/svntogit-community/blob/packages/scribus/trunk/scribus-1.5.8-poppler-22.09.0.patch
|
||||
|
||||
--- scribus/plugins/import/pdf/slaoutput.cpp.orig 2022-09-06 14:31:26 UTC
|
||||
+++ scribus/plugins/import/pdf/slaoutput.cpp
|
||||
@@ -3681,9 +3681,16 @@ void SlaOutputDev::getPenState(GfxState *state)
|
||||
break;
|
||||
}
|
||||
double lw = state->getLineWidth();
|
||||
- double *dashPattern;
|
||||
int dashLength;
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 9, 0)
|
||||
+ const double *dashPattern;
|
||||
+ const std::vector<double> &dash = state->getLineDash(&DashOffset);
|
||||
+ dashPattern = dash.data();
|
||||
+ dashLength = dash.size();
|
||||
+#else
|
||||
+ double *dashPattern;
|
||||
state->getLineDash(&dashPattern, &dashLength, &DashOffset);
|
||||
+#endif
|
||||
QVector<double> pattern(dashLength);
|
||||
for (int i = 0; i < dashLength; ++i)
|
||||
{
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user