From 6cd998411e6e0c083aba9cc885b55efa05cf9c18 Mon Sep 17 00:00:00 2001 From: miklosh Date: Sat, 17 Nov 2007 23:36:31 +0000 Subject: [PATCH] Merged from Poppler's Gfx.cc; Unset the font if it doesn't exist or we can not load it properly --- src/extension/internal/pdfinput/pdf-parser.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/extension/internal/pdfinput/pdf-parser.cpp b/src/extension/internal/pdfinput/pdf-parser.cpp index 5bf7e0fe7..f8e21ab17 100644 --- a/src/extension/internal/pdfinput/pdf-parser.cpp +++ b/src/extension/internal/pdfinput/pdf-parser.cpp @@ -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) { -- 2.30.2