Skip to content

Commit

Permalink
Fix building with Poppler 24.11
Browse files Browse the repository at this point in the history
Poppler 24.11 no longer sets the default value for faceIndex to 0 in
`FoFiTrueType::make()` and `FoFiTrueType::load()` [1], so we do it
on our end instead.

Fixes https://gitlab.com/inkscape/inkscape/-/issues/5370

[1] https://gitlab.freedesktop.org/poppler/poppler/-/commit/94467509a013dd5cf46c942baa598f2b296571f4
  • Loading branch information
krir17 committed Nov 4, 2024
1 parent 4fd19a1 commit 0399372
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/extension/internal/pdfinput/poppler-cairo-font-engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,9 @@ CairoFreeTypeFont *CairoFreeTypeFont::create(GfxFont *gfxFont, XRef *xref, FT_Li
FoFiTrueType *ff;
#endif
if (!font_data.empty()) {
ff = FoFiTrueType::make((fontchar)font_data.data(), font_data.size());
ff = FoFiTrueType::make((fontchar)font_data.data(), font_data.size(), 0);
} else {
ff = FoFiTrueType::load(fileName.c_str());
ff = FoFiTrueType::load(fileName.c_str(), 0);
}
if (!ff) {
goto err2;
Expand All @@ -444,9 +444,9 @@ CairoFreeTypeFont *CairoFreeTypeFont::create(GfxFont *gfxFont, XRef *xref, FT_Li
FoFiTrueType *ff;
#endif
if (!font_data.empty()) {
ff = FoFiTrueType::make((fontchar)font_data.data(), font_data.size());
ff = FoFiTrueType::make((fontchar)font_data.data(), font_data.size(), 0);
} else {
ff = FoFiTrueType::load(fileName.c_str());
ff = FoFiTrueType::load(fileName.c_str(), 0);
}
if (!ff) {
error(errSyntaxError, -1, "failed to load truetype font\n");
Expand Down Expand Up @@ -512,9 +512,9 @@ CairoFreeTypeFont *CairoFreeTypeFont::create(GfxFont *gfxFont, XRef *xref, FT_Li
FoFiTrueType *ff;
#endif
if (!font_data.empty()) {
ff = FoFiTrueType::make((fontchar)font_data.data(), font_data.size());
ff = FoFiTrueType::make((fontchar)font_data.data(), font_data.size(), 0);
} else {
ff = FoFiTrueType::load(fileName.c_str());
ff = FoFiTrueType::load(fileName.c_str(), 0);
}
if (ff) {
if (ff->isOpenTypeCFF()) {
Expand Down

0 comments on commit 0399372

Please sign in to comment.