Explorar el Código

Bugzilla#54120: Prevented NPEs when FOP asks Batik for AWT fonts for AFP output


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1407393 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-2_0
Mehdi Houshmand hace 11 años
padre
commit
e79feb700f
Se han modificado 2 ficheros con 8 adiciones y 1 borrados
  1. 4
    1
      src/java/org/apache/fop/svg/AbstractFOPTextPainter.java
  2. 4
    0
      status.xml

+ 4
- 1
src/java/org/apache/fop/svg/AbstractFOPTextPainter.java Ver fichero

@@ -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'))) {

+ 4
- 0
status.xml Ver fichero

@@ -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>

Cargando…
Cancelar
Guardar