From db6d86238a86116f4ef809d6fd19ed859c36b5c1 Mon Sep 17 00:00:00 2001 From: Sune Vuorela Date: Tue, 16 May 2023 15:29:04 +0200 Subject: Lookup with same rules as inserting them Inserting fonts happens without a trailing space if font style is empty. Apply teh same rules when lookin up. --- poppler/Form.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poppler/Form.cc b/poppler/Form.cc index 1fa748dc..f3ddc056 100644 --- a/poppler/Form.cc +++ b/poppler/Form.cc @@ -2714,7 +2714,7 @@ std::string Form::findFontInDefaultResources(const std::string &fontFamily, cons return {}; } - const std::string fontFamilyAndStyle = fontFamily + " " + fontStyle; + const std::string fontFamilyAndStyle = fontStyle.empty() ? fontFamily : fontFamily + " " + fontStyle; Object fontDictObj = resDict.dictLookup("Font"); assert(fontDictObj.isDict()); -- cgit v1.2.3