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 2019/09/08 10:11:12 UTC
svn commit: r1866607 -
/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDSimpleFont.java
Author: tilman
Date: Sun Sep 8 10:11:12 2019
New Revision: 1866607
URL: http://svn.apache.org/viewvc?rev=1866607&view=rev
Log:
PDFBOX-4071: improve warning log message and add comment explaining what is going on
Modified:
pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDSimpleFont.java
Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDSimpleFont.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDSimpleFont.java?rev=1866607&r1=1866606&r2=1866607&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDSimpleFont.java (original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDSimpleFont.java Sun Sep 8 10:11:12 2019
@@ -137,9 +137,18 @@ public abstract class PDSimpleFont exten
// Type1 fonts are not affected as they don't have cmaps
if (!isType1Font() && awtFont.canDisplayUpTo(string) != -1)
{
- LOG.warn("Changing font on <" + string + "> from <"
- + awtFont.getName() + "> to the default font");
+ // https://docs.oracle.com/javase/8/docs/technotes/guides/intl/fontconfig.html
+ // On windows, see this file:
+ // C:\Program Files\Java\jdkXXXX\jre\lib\fontconfig.properties.src
+ // It is useful to have these fonts on your system:
+ // Arial, MingLiU, David, MS Gothic, Gulim
+ // For example, page 2 of https://www.unicode.org/charts/PDF/U3130.pdf
+ // will fail if MingLiU is not installed.
+ // Of course, the best is to update to PDFBox 2.0.* or later.
+ String oldName = awtFont.getName();
awtFont = Font.decode(null).deriveFont(1f);
+ LOG.warn("Changing font on <" + string + "> from <"
+ + oldName + "> to the default font <" + awtFont.getName() + ">");
}
glyphs = awtFont.createGlyphVector(frc, string);
}