diff options
author | Keiron Liddle <keiron@apache.org> | 2002-02-19 13:03:15 +0000 |
---|---|---|
committer | Keiron Liddle <keiron@apache.org> | 2002-02-19 13:03:15 +0000 |
commit | bdabe33342eb965037dbfcd5f50e0bc2d6160bf8 (patch) | |
tree | 5f23a737cf7f24ad8c96a660fa930a8d9664f1f1 /src/org | |
parent | 915bd9cd20b136de493c54aeea2e7e4a1b8fe5f3 (diff) | |
download | xmlgraphics-fop-bdabe33342eb965037dbfcd5f50e0bc2d6160bf8.tar.gz xmlgraphics-fop-bdabe33342eb965037dbfcd5f50e0bc2d6160bf8.zip |
fixed compile error
add extra check for text drawing, seems to have a problem with
large fonts and may have nulll size
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194655 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/apache/fop/svg/PDFTextElementBridge.java | 3 | ||||
-rw-r--r-- | src/org/apache/fop/svg/PDFTextPainter.java | 4 | ||||
-rw-r--r-- | src/org/apache/fop/svg/PDFTranscoder.java | 4 |
3 files changed, 7 insertions, 4 deletions
diff --git a/src/org/apache/fop/svg/PDFTextElementBridge.java b/src/org/apache/fop/svg/PDFTextElementBridge.java index a4a3759ed..7d9aee21d 100644 --- a/src/org/apache/fop/svg/PDFTextElementBridge.java +++ b/src/org/apache/fop/svg/PDFTextElementBridge.java @@ -68,6 +68,9 @@ public class PDFTextElementBridge extends SVGTextElementBridge { if(((int)fs) != fs) { return false; } + if(fs > 36) { + return false; + } Element nodeElement; for (Node n = element.getFirstChild(); diff --git a/src/org/apache/fop/svg/PDFTextPainter.java b/src/org/apache/fop/svg/PDFTextPainter.java index dce7d5231..692986bcd 100644 --- a/src/org/apache/fop/svg/PDFTextPainter.java +++ b/src/org/apache/fop/svg/PDFTextPainter.java @@ -74,12 +74,16 @@ public class PDFTextPainter implements TextPainter { (Vector)aci.getAttribute(GVTAttributedCharacterIterator.TextAttribute.GVT_FONT_FAMILIES); Paint forg = (Paint)aci.getAttribute(TextAttribute.FOREGROUND); Float size = (Float)aci.getAttribute(TextAttribute.SIZE); + if(size == null) { + return; + } Stroke stroke = (Stroke)aci.getAttribute(GVTAttributedCharacterIterator.TextAttribute.STROKE); Float xpos = (Float)aci.getAttribute(GVTAttributedCharacterIterator.TextAttribute.X); Float ypos = (Float)aci.getAttribute(GVTAttributedCharacterIterator.TextAttribute.Y); +System.out.println("data:" + size + ":" + forg + ":" + xpos + ":" + ypos); Float posture = (Float)aci.getAttribute(TextAttribute.POSTURE); Float taWeight = (Float)aci.getAttribute(TextAttribute.WEIGHT); diff --git a/src/org/apache/fop/svg/PDFTranscoder.java b/src/org/apache/fop/svg/PDFTranscoder.java index dea3df6d2..54ba7a3d3 100644 --- a/src/org/apache/fop/svg/PDFTranscoder.java +++ b/src/org/apache/fop/svg/PDFTranscoder.java @@ -95,9 +95,6 @@ import org.w3c.dom.svg.SVGAElement; import org.w3c.dom.svg.SVGDocument; import org.w3c.dom.svg.SVGSVGElement; -// <!> FIXME : Those import clauses will change with new design -import org.apache.batik.gvt.renderer.StaticRendererFactory; - /** * This class enables to transcode an input to a pdf document. * @@ -177,7 +174,6 @@ public class PDFTranscoder extends XMLAbstractTranscoder { // build the GVT tree GVTBuilder builder = new GVTBuilder(); - ImageRendererFactory rendFactory = new StaticRendererFactory(); BridgeContext ctx = new BridgeContext(userAgent); TextPainter textPainter = null; textPainter = new StrokingTextPainter(); |