Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.31, 3.0.2 PDFBox
-
None
Description
On the attached PDF the non embedded font "Wingdings,Bolt" is not found and replaced by another font.
Is:
Expected:
There are more fonts that are not found. For those Acrobat also seems to use an replacement, "Adobe Sans MM". Those should be ok.
Warning [PDTrueTypeFont] Using fallback font CourierNewPS-BoldMT for Wingdings,Bold Warning [PDTrueTypeFont] Using fallback font CourierNewPSMT for CorporateACon Warning [PDTrueTypeFont] Using fallback font CourierNewPSMT for CorpoSLig
I propose an addition to the FontMapperImpl in findFont:
@@ -441,6 +441,16 @@ final class FontMapperImpl implements FontMapper return info.getFont(); } + if (postScriptName.contains(",")) { + postScriptName = postScriptName.substring(0, postScriptName.indexOf(",")); + // try cutting font style and getting the basefont, eg. for "Wingdings,Bolt" to "Wingding-Regular" (including the following step) + info = getFont(format, postScriptName); + if (info != null) + { + return info.getFont(); + } + } + // try appending "-Regular", works for Wingdings on windows info = getFont(format, postScriptName + "-Regular"); if (info != null)