aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/java/org/apache/fop/svg/AbstractFOPTextPainter.java5
-rw-r--r--status.xml4
2 files changed, 8 insertions, 1 deletions
diff --git a/src/java/org/apache/fop/svg/AbstractFOPTextPainter.java b/src/java/org/apache/fop/svg/AbstractFOPTextPainter.java
index 49f5a1b75..c41271caa 100644
--- a/src/java/org/apache/fop/svg/AbstractFOPTextPainter.java
+++ b/src/java/org/apache/fop/svg/AbstractFOPTextPainter.java
@@ -336,7 +336,7 @@ public abstract class AbstractFOPTextPainter implements TextPainter {
private Font getFont(AttributedCharacterIterator aci) {
Font[] fonts = ACIUtils.findFontsForBatikACI(aci, nativeTextHandler.getFontInfo());
- return fonts[0];
+ return fonts == null ? null : fonts[0];
}
private float getStringWidth(String str, Font font) {
@@ -360,6 +360,9 @@ public abstract class AbstractFOPTextPainter implements TextPainter {
}
private boolean hasUnsupportedGlyphs(String str, Font font) {
+ if (font == null) {
+ return true;
+ }
for (int i = 0; i < str.length(); i++) {
char c = str.charAt(i);
if (!((c == ' ') || (c == '\n') || (c == '\r') || (c == '\t'))) {
diff --git a/status.xml b/status.xml
index bcf8c2475..990a15f5e 100644
--- a/status.xml
+++ b/status.xml
@@ -59,6 +59,10 @@
documents. Example: the fix of marks layering will be such a case when it's done.
-->
<release version="FOP Trunk" date="TBD">
+ <action context="Fonts" dev="MH" type="add" fixes-bug="54120">
+ Created a simple mechanism to avoid NPEs when AWT fonts are requested from Batik
+ for AFP output.
+ </action>
<action context="Renderers" dev="VH" type="add" fixes-bug="54081">
PDF accessibility: properly tag hyphenated words.
</action>