]> source.dussan.org Git - poi.git/commitdiff
Fix further Windows JVM 6 font rendering errors - OOM and EXCEPTION_ACCESS_VIOLATION
authorAndreas Beeker <kiwiwings@apache.org>
Mon, 31 Jul 2017 12:25:23 +0000 (12:25 +0000)
committerAndreas Beeker <kiwiwings@apache.org>
Mon, 31 Jul 2017 12:25:23 +0000 (12:25 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1803528 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/sl/draw/DrawFactory.java
src/java/org/apache/poi/sl/draw/DrawTextParagraph.java
src/java/org/apache/poi/util/JvmBugs.java

index 376a8daab828356efba6a2b5e437e4b139609b75..631b51e0c3c1e217e9f6706e48593ab481364b61 100644 (file)
@@ -228,7 +228,12 @@ public class DrawFactory {
             graphics.setRenderingHint(Drawable.FONT_MAP, fontMap);
         }
         
-        String fonts[][] = { { "Calibri", "Lucida Sans" }, { "Cambria", "Lucida Bright" } };
+        String fonts[][] = {
+            { "Calibri", "Lucida Sans" },
+            { "Cambria", "Lucida Bright" },
+            { "Times New Roman", "Lucida Bright" },
+            { "serif", "Lucida Bright" }
+        };
 
         for (String f[] : fonts) {
             if (!fontMap.containsKey(f[0])) {
index 7f708d1249d4b7531823b4e4737d4b9bd0a339c6..c3c13288670193c366933c59262006cb9272f307 100644 (file)
@@ -254,6 +254,7 @@ public class DrawTextParagraph implements Drawable {
         lines.clear();
 
         DrawFactory fact = DrawFactory.getInstance(graphics);
+        fact.fixFonts(graphics);
         StringBuilder text = new StringBuilder();
         AttributedString at = getAttributedString(graphics, text);
         boolean emptyParagraph = ("".equals(text.toString().trim()));
index 221d74e643861d28e0dbe5f9fd5ed961dc78adf2..d79c8d65b59c42f3f728080c831f3a8a0c9f09da 100644 (file)
@@ -25,7 +25,7 @@ public class JvmBugs {
      * The LineBreakMeasurer is used for calculating text bounds.
      * The last official JDK 6 version (1.6.0_45) and also JDK 7 (1.7.0_21)
      * for Windows are affected. For JDK 7 - update to a more recent version.
-     * For JDK 6 - replace the fontmanager.dll with the previous release.
+     * For JDK 6 - replace the fontmanager.dll with the previous release (1.6.0_43).
      * 
      * For performance reasons, this method only checks for a windows jvm
      * with version 1.6.0_45 and 1.7.0_21.
@@ -40,6 +40,7 @@ public class JvmBugs {
      * @see <a href="http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/ss/usermodel/BaseTestSheetAutosizeColumn.java?view=markup">Workaround for XSSF and HSSF</a>
      * @see <a href="https://issues.apache.org/bugzilla/show_bug.cgi?id=54904">POI Bug #54904</a>
      * @see <a href="http://bugs.java.com/view_bug.do?bug_id=6501991">JDK Bug #6501991</a>
+     * @see <a href="http://bugs.java.com/view_bug.do?bug_id=8013716">JDK Bug #8013716</a>
      * @see <a href="https://bitbucket.org/fakraemer/line-break-measurer-test">LineBreakMeasurerTest</a>
      */
     public static boolean hasLineBreakMeasurerBug() {