Code

Merged from Poppler's Gfx.cc; Unset the font if it doesn't exist or we can not load...
authormiklosh <miklosh@users.sourceforge.net>
Sat, 17 Nov 2007 23:36:31 +0000 (23:36 +0000)
committermiklosh <miklosh@users.sourceforge.net>
Sat, 17 Nov 2007 23:36:31 +0000 (23:36 +0000)
src/extension/internal/pdfinput/pdf-parser.cpp

index 5bf7e0fe700333923e17e913eb1d97a3b1cddb7f..f8e21ab1768f2f913654b9789f27a6d017fe6eb4 100644 (file)
@@ -2014,6 +2014,10 @@ void PdfParser::opSetFont(Object args[], int numArgs) {
   GfxFont *font;
 
   if (!(font = res->lookupFont(args[0].getName()))) {
+    // unsetting the font (drawing no text) is better than using the
+    // previous one and drawing random glyphs from it
+    state->setFont(NULL, args[1].getNum());
+    fontChanged = gTrue;
     return;
   }
   if (printCommands) {