[poppler] poppler/Form.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed May 17 12:36:45 UTC 2023


 poppler/Form.cc |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit db6d86238a86116f4ef809d6fd19ed859c36b5c1
Author: Sune Vuorela <sune at vuorela.dk>
Date:   Tue May 16 15:29:04 2023 +0200

    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.

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());


More information about the poppler mailing list