diff options
author | Peter Hancock <phancock@apache.org> | 2012-06-29 11:22:42 +0000 |
---|---|---|
committer | Peter Hancock <phancock@apache.org> | 2012-06-29 11:22:42 +0000 |
commit | 3e31e071ea47f37ef7f8749b324dfdfe76745d18 (patch) | |
tree | 7d3b646c521349634592b62556a8832ec082cc9c /src/sandbox/org/apache/fop/render/mif | |
parent | ae8a5035235e1262e412e1eacd0eb3adfaef83ef (diff) | |
parent | 015538e0f11f031e3d7bd05db8c29e2a40365678 (diff) | |
download | xmlgraphics-fop-3e31e071ea47f37ef7f8749b324dfdfe76745d18.tar.gz xmlgraphics-fop-3e31e071ea47f37ef7f8749b324dfdfe76745d18.zip |
Merged trunk@1354651
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_RoundedCorners@1355321 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/sandbox/org/apache/fop/render/mif')
-rw-r--r-- | src/sandbox/org/apache/fop/render/mif/MIFHandler.java | 68 | ||||
-rw-r--r-- | src/sandbox/org/apache/fop/render/mif/RefElement.java | 2 |
2 files changed, 45 insertions, 25 deletions
diff --git a/src/sandbox/org/apache/fop/render/mif/MIFHandler.java b/src/sandbox/org/apache/fop/render/mif/MIFHandler.java index 0adf8bf5b..5ef4c0940 100644 --- a/src/sandbox/org/apache/fop/render/mif/MIFHandler.java +++ b/src/sandbox/org/apache/fop/render/mif/MIFHandler.java @@ -19,16 +19,20 @@ package org.apache.fop.render.mif; -// Java import java.io.IOException; import java.io.OutputStream; +import org.xml.sax.SAXException; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + import org.apache.fop.apps.FOUserAgent; import org.apache.fop.fo.FOEventHandler; +import org.apache.fop.fo.FOText; import org.apache.fop.fo.flow.BasicLink; import org.apache.fop.fo.flow.Block; +import org.apache.fop.fo.flow.Character; import org.apache.fop.fo.flow.ExternalGraphic; import org.apache.fop.fo.flow.Footnote; import org.apache.fop.fo.flow.FootnoteBody; @@ -37,6 +41,8 @@ import org.apache.fop.fo.flow.InstreamForeignObject; import org.apache.fop.fo.flow.Leader; import org.apache.fop.fo.flow.ListBlock; import org.apache.fop.fo.flow.ListItem; +import org.apache.fop.fo.flow.ListItemBody; +import org.apache.fop.fo.flow.ListItemLabel; import org.apache.fop.fo.flow.PageNumber; import org.apache.fop.fo.flow.table.Table; import org.apache.fop.fo.flow.table.TableBody; @@ -49,9 +55,9 @@ import org.apache.fop.fo.pagination.Flow; import org.apache.fop.fo.pagination.PageSequence; import org.apache.fop.fo.pagination.PageSequenceMaster; import org.apache.fop.fo.pagination.SimplePageMaster; +import org.apache.fop.fo.pagination.StaticContent; import org.apache.fop.fonts.FontSetup; import org.apache.fop.render.DefaultFontResolver; -import org.xml.sax.SAXException; // TODO: do we really want every method throwing a SAXException @@ -84,7 +90,8 @@ public class MIFHandler extends FOEventHandler { public MIFHandler(FOUserAgent ua, OutputStream os) { super(ua); outStream = os; - FontSetup.setup(fontInfo, null, new DefaultFontResolver(ua)); + boolean base14Kerning = false; //TODO - FIXME + FontSetup.setup(fontInfo, null, new DefaultFontResolver(ua), base14Kerning); } /** {@inheritDoc} */ @@ -265,27 +272,27 @@ public class MIFHandler extends FOEventHandler { } /** {@inheritDoc} */ - public void startListLabel() { + public void startListLabel(ListItemLabel listItemLabel) { } /** {@inheritDoc} */ - public void endListLabel() { + public void endListLabel(ListItemLabel listItemLabel) { } /** {@inheritDoc} */ - public void startListBody() { + public void startListBody(ListItemBody listItemBody) { } /** {@inheritDoc} */ - public void endListBody() { + public void endListBody(ListItemBody listItemBody) { } /** {@inheritDoc} */ - public void startStatic() { + public void startStatic(StaticContent staticContent) { } /** {@inheritDoc} */ - public void endStatic() { + public void endStatic(StaticContent staticContent) { } /** {@inheritDoc} */ @@ -301,7 +308,7 @@ public class MIFHandler extends FOEventHandler { } /** {@inheritDoc} */ - public void endLink() { + public void endLink(BasicLink basicLink) { } /** {@inheritDoc} */ @@ -313,7 +320,11 @@ public class MIFHandler extends FOEventHandler { } /** {@inheritDoc} */ - public void foreignObject(InstreamForeignObject ifo) { + public void startInstreamForeignObject(InstreamForeignObject ifo) { + } + + /** {@inheritDoc} */ + public void endInstreamForeignObject(InstreamForeignObject ifo) { } /** {@inheritDoc} */ @@ -333,19 +344,37 @@ public class MIFHandler extends FOEventHandler { } /** {@inheritDoc} */ - public void leader(Leader l) { + public void startLeader(Leader l) { + } + + /** {@inheritDoc} */ + public void endLeader(Leader l) { + } + + public void character(Character c) { + appendCharacters ( new String ( new char[] {c.getCharacter()} ) ); + } + + /** {@inheritDoc} */ + public void characters(FOText foText) { + appendCharacters ( foText.getCharSequence().toString() ); + } + + /** {@inheritDoc} */ + public void startPageNumber(PageNumber pagenum) { } /** {@inheritDoc} */ - public void characters(char[] data, int start, int length) { + public void endPageNumber(PageNumber pagenum) { + } + + private void appendCharacters ( String str ) { if (para != null) { - String str = new String(data, start, length); str = str.trim(); // break into nice length chunks if (str.length() == 0) { return; } - MIFElement line = new MIFElement("ParaLine"); MIFElement prop = new MIFElement("TextRectID"); prop.setValue("2"); @@ -353,17 +382,8 @@ public class MIFHandler extends FOEventHandler { prop = new MIFElement("String"); prop.setValue("\"" + str + "\""); line.addElement(prop); - para.addElement(line); } } - - /** {@inheritDoc} */ - public void startPageNumber(PageNumber pagenum) { - } - - /** {@inheritDoc} */ - public void endPageNumber(PageNumber pagenum) { - } } diff --git a/src/sandbox/org/apache/fop/render/mif/RefElement.java b/src/sandbox/org/apache/fop/render/mif/RefElement.java index b23dffa2b..0849f4f69 100644 --- a/src/sandbox/org/apache/fop/render/mif/RefElement.java +++ b/src/sandbox/org/apache/fop/render/mif/RefElement.java @@ -38,7 +38,7 @@ public class RefElement extends MIFElement { super(name); } - /** + /** * @param key a key * @return an mif element */ |