diff --git a/poppler/GfxFont.h b/poppler/GfxFont.h index febb902..f22ac77 100644 --- a/poppler/GfxFont.h +++ b/poppler/GfxFont.h @@ -211,6 +211,15 @@ public: GBool getEmbeddedFontID(Ref *embID) { *embID = embFontID; return embFontID.num >= 0; } + // Invalidate an embedded font + // Returns false if there is no embedded font. + GBool invalidateEmbeddedFont() { + if (embFontID.num >= 0) { + embFontID.num = -1; return gTrue; + } + return gFalse; + } + // Get the PostScript font name for the embedded font. Returns // NULL if there is no embedded font. GooString *getEmbeddedFontName() { return embFontName; } diff --git a/poppler/SplashOutputDev.cc b/poppler/SplashOutputDev.cc index 097260b..b75ed57 100644 --- a/poppler/SplashOutputDev.cc +++ b/poppler/SplashOutputDev.cc @@ -1946,6 +1946,7 @@ void SplashOutputDev::doUpdateFont(GfxState *state) { } // check the font file cache +reload: id = new SplashOutFontFileID(gfxFont->getID()); if ((fontFile = fontEngine->getFontFile(id))) { delete id; @@ -1989,6 +1990,7 @@ void SplashOutputDev::doUpdateFont(GfxState *state) { error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)"); + if (gfxFont->invalidateEmbeddedFont()) goto reload; goto err2; } break; @@ -2000,6 +2002,7 @@ void SplashOutputDev::doUpdateFont(GfxState *state) { error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)"); + if (gfxFont->invalidateEmbeddedFont()) goto reload; goto err2; } break; @@ -2011,6 +2014,7 @@ void SplashOutputDev::doUpdateFont(GfxState *state) { error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)"); + if (gfxFont->invalidateEmbeddedFont()) goto reload; goto err2; } break; @@ -2046,6 +2050,7 @@ void SplashOutputDev::doUpdateFont(GfxState *state) { error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)"); + if (gfxFont->invalidateEmbeddedFont()) goto reload; goto err2; } break; @@ -2057,6 +2062,7 @@ void SplashOutputDev::doUpdateFont(GfxState *state) { error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)"); + if (gfxFont->invalidateEmbeddedFont()) goto reload; goto err2; } break; @@ -2077,6 +2083,7 @@ void SplashOutputDev::doUpdateFont(GfxState *state) { error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)"); + if (gfxFont->invalidateEmbeddedFont()) goto reload; goto err2; } break; @@ -2113,6 +2120,7 @@ void SplashOutputDev::doUpdateFont(GfxState *state) { error(errSyntaxError, -1, "Couldn't create a font for '{0:s}'", gfxFont->getName() ? gfxFont->getName()->getCString() : "(unnamed)"); + if (gfxFont->invalidateEmbeddedFont()) goto reload; goto err2; } break;