You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2024/04/18 07:32:42 UTC
svn commit: r1917095 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FontMapperImpl.java
Author: tilman
Date: Thu Apr 18 07:32:42 2024
New Revision: 1917095
URL: http://svn.apache.org/viewvc?rev=1917095&view=rev
Log:
PDFBOX-5806: try cutting font style and getting the basefont, as suggested by Oliver Schmidtmer
Modified:
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FontMapperImpl.java
Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FontMapperImpl.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FontMapperImpl.java?rev=1917095&r1=1917094&r2=1917095&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FontMapperImpl.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FontMapperImpl.java Thu Apr 18 07:32:42 2024
@@ -461,6 +461,18 @@ final class FontMapperImpl implements Fo
return info.getFont();
}
+ if (postScriptName.contains(","))
+ {
+ postScriptName = postScriptName.substring(0, postScriptName.indexOf(","));
+ // PDFBOX-5806: 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)