diff options
author | Jeremias Maerki <jeremias@apache.org> | 2009-04-20 06:50:59 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2009-04-20 06:50:59 +0000 |
commit | e471816c05743e7e1517710cedb5cc256901d3e6 (patch) | |
tree | ee9d62bf08460fcca71b28b24c5de80cf3a25e96 /src/java/org/apache/fop/svg/AbstractFOPTextElementBridge.java | |
parent | 5deedc814cedf4e1c2ffa746a22bdba34b031d5d (diff) | |
download | xmlgraphics-fop-e471816c05743e7e1517710cedb5cc256901d3e6.tar.gz xmlgraphics-fop-e471816c05743e7e1517710cedb5cc256901d3e6.zip |
Bugzilla #47000:
Added a custom text painter for rendering SVG text using text operators when rendering to PostScript or EPS. Text is no longer painted as shapes, thus creating much smaller files.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@766594 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/svg/AbstractFOPTextElementBridge.java')
-rw-r--r-- | src/java/org/apache/fop/svg/AbstractFOPTextElementBridge.java | 48 |
1 files changed, 2 insertions, 46 deletions
diff --git a/src/java/org/apache/fop/svg/AbstractFOPTextElementBridge.java b/src/java/org/apache/fop/svg/AbstractFOPTextElementBridge.java index 53b8e2ad5..aec4126b4 100644 --- a/src/java/org/apache/fop/svg/AbstractFOPTextElementBridge.java +++ b/src/java/org/apache/fop/svg/AbstractFOPTextElementBridge.java @@ -19,13 +19,13 @@ package org.apache.fop.svg; +import org.w3c.dom.Element; + import org.apache.batik.bridge.BridgeContext; import org.apache.batik.bridge.SVGTextElementBridge; import org.apache.batik.gvt.GraphicsNode; import org.apache.batik.gvt.TextNode; import org.apache.batik.gvt.TextPainter; -import org.w3c.dom.Element; -import org.w3c.dom.Node; /** * Bridge class for the <text> element. @@ -65,49 +65,5 @@ public abstract class AbstractFOPTextElementBridge extends SVGTextElementBridge return node; } - /** - * Check if text element contains simple text. - * This checks the children of the text element to determine - * if the text is simple. The text is simple if it can be rendered - * with basic text drawing algorithms. This means there are no - * alternate characters, the font is known and there are no effects - * applied to the text. - * - * @param ctx the bridge context - * @param element the svg text element - * @param node the graphics node - * @return true if this text is simple of false if it cannot be - * easily rendered using normal drawString on the Graphics2D - */ - protected boolean isSimple(BridgeContext ctx, Element element, GraphicsNode node) { - for (Node n = element.getFirstChild(); - n != null; - n = n.getNextSibling()) { - - switch (n.getNodeType()) { - case Node.ELEMENT_NODE: - - if (n.getLocalName().equals(SVG_TSPAN_TAG) - || n.getLocalName().equals(SVG_ALT_GLYPH_TAG)) { - return false; - } else if (n.getLocalName().equals(SVG_TEXT_PATH_TAG)) { - return false; - } else if (n.getLocalName().equals(SVG_TREF_TAG)) { - return false; - } - break; - case Node.TEXT_NODE: - case Node.CDATA_SECTION_NODE: - default: - } - } - - /*if (CSSUtilities.convertFilter(element, node, ctx) != null) { - return false; - }*/ - - return true; - } - } |