diff options
author | Jeremias Maerki <jeremias@apache.org> | 2008-12-22 14:11:52 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2008-12-22 14:11:52 +0000 |
commit | 8ef2099f5d82ff553b2c34420eb269d1e9d07b22 (patch) | |
tree | c92e300da257596719bca296811b2809adb635b9 /src/java/org/apache | |
parent | e8383ed28560a67758a45f0b421021b210d6ca1f (diff) | |
download | xmlgraphics-fop-8ef2099f5d82ff553b2c34420eb269d1e9d07b22.tar.gz xmlgraphics-fop-8ef2099f5d82ff553b2c34420eb269d1e9d07b22.zip |
Need to use xml:space="preserve" on text elements in IF and SVG output to avoid problems with editing those files in XML editors and rendering SVG text starting or ending with whitespace.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign@728699 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache')
-rw-r--r-- | src/java/org/apache/fop/render/intermediate/IFSerializer.java | 1 | ||||
-rw-r--r-- | src/java/org/apache/fop/util/XMLConstants.java | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/render/intermediate/IFSerializer.java b/src/java/org/apache/fop/render/intermediate/IFSerializer.java index c54fe6407..d6df81472 100644 --- a/src/java/org/apache/fop/render/intermediate/IFSerializer.java +++ b/src/java/org/apache/fop/render/intermediate/IFSerializer.java @@ -511,6 +511,7 @@ public class IFSerializer extends AbstractXMLWritingIFDocumentHandler public void drawText(int x, int y, int[] dx, int[] dy, String text) throws IFException { try { AttributesImpl atts = new AttributesImpl(); + XMLUtil.addAttribute(atts, XMLConstants.XML_SPACE, "preserve"); addAttribute(atts, "x", Integer.toString(x)); addAttribute(atts, "y", Integer.toString(y)); if (dx != null) { diff --git a/src/java/org/apache/fop/util/XMLConstants.java b/src/java/org/apache/fop/util/XMLConstants.java index 1f85c3b07..34cc65e2a 100644 --- a/src/java/org/apache/fop/util/XMLConstants.java +++ b/src/java/org/apache/fop/util/XMLConstants.java @@ -32,6 +32,9 @@ public interface XMLConstants { String XML_PREFIX = "xml"; /** XML namespace URI */ String XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace"; + /** xml:space attribute */ + org.apache.xmlgraphics.util.QName XML_SPACE = new org.apache.xmlgraphics.util.QName( + XML_NAMESPACE, XML_PREFIX, "space"); /** XMLNS namespace prefix */ String XMLNS_PREFIX = "xmlns"; |