|
| 1 | +From 14a287fc1db2a44abfe1743260554447b31b4adf Mon Sep 17 00:00:00 2001 |
| 2 | +From: Jean Ghali <jghali@libertysurf.fr> |
| 3 | +Date: Tue, 5 May 2026 22:29:32 +0000 |
| 4 | +Subject: [PATCH] #17808: Fix failure to build with poppler 26.05.0 |
| 5 | + |
| 6 | +git-svn-id: svn://scribus.net/trunk/Scribus@27545 11d20701-8431-0410-a711-e3c959e3b870 |
| 7 | +--- |
| 8 | + scribus/plugins/import/pdf/importpdfconfig.h | 4 ++++ |
| 9 | + scribus/plugins/import/pdf/slaoutput.cpp | 24 +++++++++++++++++--- |
| 10 | + 2 files changed, 25 insertions(+), 3 deletions(-) |
| 11 | + |
| 12 | +diff --git a/scribus/plugins/import/pdf/importpdfconfig.h b/scribus/plugins/import/pdf/importpdfconfig.h |
| 13 | +index bd4d30f28f16c0955a5053919cae475e7f91086d..cbd5a7e00da314f4f8232565365e2d72eb398eef 100644 |
| 14 | +--- a/scribus/plugins/import/pdf/importpdfconfig.h |
| 15 | ++++ b/scribus/plugins/import/pdf/importpdfconfig.h |
| 16 | +@@ -21,4 +21,8 @@ for which a new license (GPL+exception) is in place. |
| 17 | + #define POPPLER_CONST_25_02 |
| 18 | + #endif |
| 19 | + |
| 20 | ++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 5, 0) |
| 21 | ++using SplashCoord = double; |
| 22 | ++#endif |
| 23 | ++ |
| 24 | + #endif |
| 25 | +diff --git a/scribus/plugins/import/pdf/slaoutput.cpp b/scribus/plugins/import/pdf/slaoutput.cpp |
| 26 | +index 2e964358534c3684e3efcdddb2e70da3d7224729..30f82eebf0810809a9132db86b9bbd806f384f9c 100644 |
| 27 | +--- a/scribus/plugins/import/pdf/slaoutput.cpp |
| 28 | ++++ b/scribus/plugins/import/pdf/slaoutput.cpp |
| 29 | +@@ -3115,7 +3115,13 @@ void SlaOutputDev::updateFont(GfxState *state) |
| 30 | + // load the font file |
| 31 | + switch (fontType) { |
| 32 | + case fontType1: |
| 33 | +-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0) |
| 34 | ++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 5, 0) |
| 35 | ++ if (!(fontFile = m_fontEngine->loadType1Font(std::move(id), std::move(fontsrc), static_cast<Gfx8BitFont*>(gfxFont)->getEncoding(), fontLoc->fontNum))) |
| 36 | ++ { |
| 37 | ++ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)"); |
| 38 | ++ goto err2; |
| 39 | ++ } |
| 40 | ++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0) |
| 41 | + if (!(fontFile = m_fontEngine->loadType1Font(std::move(id), std::move(fontsrc), (const char**) ((Gfx8BitFont*) gfxFont)->getEncoding(), fontLoc->fontNum))) |
| 42 | + { |
| 43 | + error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)"); |
| 44 | +@@ -3136,7 +3142,13 @@ void SlaOutputDev::updateFont(GfxState *state) |
| 45 | + #endif |
| 46 | + break; |
| 47 | + case fontType1C: |
| 48 | +-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0) |
| 49 | ++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 5, 0) |
| 50 | ++ if (!(fontFile = m_fontEngine->loadType1CFont(std::move(id), std::move(fontsrc), static_cast<Gfx8BitFont*>(gfxFont)->getEncoding(), fontLoc->fontNum))) |
| 51 | ++ { |
| 52 | ++ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)"); |
| 53 | ++ goto err2; |
| 54 | ++ } |
| 55 | ++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0) |
| 56 | + if (!(fontFile = m_fontEngine->loadType1CFont(std::move(id), std::move(fontsrc), (const char**) ((Gfx8BitFont*) gfxFont)->getEncoding(), fontLoc->fontNum))) |
| 57 | + { |
| 58 | + error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)"); |
| 59 | +@@ -3157,7 +3169,13 @@ void SlaOutputDev::updateFont(GfxState *state) |
| 60 | + #endif |
| 61 | + break; |
| 62 | + case fontType1COT: |
| 63 | +-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0) |
| 64 | ++#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 5, 0) |
| 65 | ++ if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(std::move(id), std::move(fontsrc), static_cast<Gfx8BitFont*>(gfxFont)->getEncoding(), fontLoc->fontNum))) |
| 66 | ++ { |
| 67 | ++ error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)"); |
| 68 | ++ goto err2; |
| 69 | ++ } |
| 70 | ++#elif POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(26, 2, 0) |
| 71 | + if (!(fontFile = m_fontEngine->loadOpenTypeT1CFont(std::move(id), std::move(fontsrc), (const char**) ((Gfx8BitFont*) gfxFont)->getEncoding(), fontLoc->fontNum))) |
| 72 | + { |
| 73 | + error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->c_str() : "(unnamed)"); |
0 commit comments