From b7846469695c83a1740b6f72023e8fbfbf9485df Mon Sep 17 00:00:00 2001 From: Jakub Melka Date: Thu, 9 Jul 2020 11:52:42 +0200 Subject: [PATCH] Bugfix - select standard font if no font is matched --- PdfForQtLib/sources/pdffont.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/PdfForQtLib/sources/pdffont.cpp b/PdfForQtLib/sources/pdffont.cpp index 8055331..b13bc39 100644 --- a/PdfForQtLib/sources/pdffont.cpp +++ b/PdfForQtLib/sources/pdffont.cpp @@ -252,6 +252,12 @@ QByteArray PDFSystemFontInfoStorage::loadFont(const FontDescriptor* descriptor, ReleaseDC(NULL, hdc); #endif + if (result.isEmpty() && standardFontType == StandardFontType::Invalid) + { + reporter->reportRenderError(RenderErrorType::Warning, PDFTranslationContext::tr("Inexact font substitution: font %1 replaced by standard font Times New Roman.").arg(fontName)); + result = loadFont(descriptor, StandardFontType::TimesRoman, reporter); + } + return result; }