aboutsummaryrefslogtreecommitdiffstats
path: root/src/sandbox/org/apache
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2009-02-05 16:27:08 +0000
committerJeremias Maerki <jeremias@apache.org>2009-02-05 16:27:08 +0000
commit4e27a1c9dd7246dff9d9380755171f179e3fcb8a (patch)
tree93817887ac0a99f6a3c1b736cae9ce5688eb4bab /src/sandbox/org/apache
parent7fbf442044c42fce773c36cd9aea80694abf007d (diff)
downloadxmlgraphics-fop-4e27a1c9dd7246dff9d9380755171f179e3fcb8a.tar.gz
xmlgraphics-fop-4e27a1c9dd7246dff9d9380755171f179e3fcb8a.zip
Performance improvements and file-size reductions by introducing letter-spacing and word-spacing attributes in new IF (as mentioned on fop-dev).
Allow to control whether kerning information is loaded from fonts. Started support for AFP font embedding (incomplete and currently disabled) git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign@741165 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/sandbox/org/apache')
-rw-r--r--src/sandbox/org/apache/fop/render/svg/SVGPainter.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/sandbox/org/apache/fop/render/svg/SVGPainter.java b/src/sandbox/org/apache/fop/render/svg/SVGPainter.java
index d427096be..0ee13c021 100644
--- a/src/sandbox/org/apache/fop/render/svg/SVGPainter.java
+++ b/src/sandbox/org/apache/fop/render/svg/SVGPainter.java
@@ -325,19 +325,23 @@ public class SVGPainter extends AbstractIFPainter implements SVGConstants {
}
/** {@inheritDoc} */
- public void drawText(int x, int y, int[] dx, int[] dy, String text) throws IFException {
+ public void drawText(int x, int y, int letterSpacing, int wordSpacing, int[] dx, String text)
+ throws IFException {
try {
establish(MODE_TEXT);
AttributesImpl atts = new AttributesImpl();
XMLUtil.addAttribute(atts, XMLConstants.XML_SPACE, "preserve");
XMLUtil.addAttribute(atts, "x", Integer.toString(x));
XMLUtil.addAttribute(atts, "y", Integer.toString(y));
+ if (letterSpacing != 0) {
+ XMLUtil.addAttribute(atts, "letter-spacing", Integer.toString(letterSpacing));
+ }
+ if (wordSpacing != 0) {
+ XMLUtil.addAttribute(atts, "word-spacing", Integer.toString(wordSpacing));
+ }
if (dx != null) {
XMLUtil.addAttribute(atts, "dx", IFUtil.toString(dx));
}
- if (dy != null) {
- XMLUtil.addAttribute(atts, "dy", IFUtil.toString(dy));
- }
handler.startElement("text", atts);
char[] chars = text.toCharArray();
handler.characters(chars, 0, chars.length);