]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
some examples for placing svg within blocks and text
authorKeiron Liddle <keiron@apache.org>
Tue, 19 Sep 2000 00:10:08 +0000 (00:10 +0000)
committerKeiron Liddle <keiron@apache.org>
Tue, 19 Sep 2000 00:10:08 +0000 (00:10 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193705 13f79535-47bb-0310-9956-ffa450edef68

docs/examples/fo/instream.fo [new file with mode: 0644]

diff --git a/docs/examples/fo/instream.fo b/docs/examples/fo/instream.fo
new file mode 100644 (file)
index 0000000..327a6aa
--- /dev/null
@@ -0,0 +1,132 @@
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:svg="http://www.w3.org/2000/svg">
+<fo:layout-master-set>
+  <fo:simple-page-master master-name="one">
+    <fo:region-body margin-top="25pt" margin-bottom="25pt" margin-left="50pt" margin-right="50pt" />
+  </fo:simple-page-master>
+</fo:layout-master-set>
+<fo:page-sequence master-name="one">
+<fo:flow flow-name="xsl-region-body">
+<fo:instream-foreign-object>
+<svg:svg width="250" height="50">
+  <svg:g style="fill:red; stroke:#000000">
+     <svg:rect x="0" y="0" width="15" height="15"/>
+     <svg:rect x="5" y="5" width="15" height="15"/>
+  </svg:g>
+    <svg:text x="10" y="30">SVG placed in flow before anything</svg:text>
+</svg:svg>
+</fo:instream-foreign-object>
+      <fo:block>This is used to show how foreign objects are placed in a line area.</fo:block>
+<fo:instream-foreign-object>
+<svg:svg width="250" height="50">
+  <svg:g style="fill:red; stroke:#000000">
+     <svg:rect x="0" y="0" width="15" height="15"/>
+     <svg:rect x="5" y="5" width="15" height="15"/>
+  </svg:g>
+    <svg:text x="10" y="30">SVG placed in flow after a block</svg:text>
+</svg:svg>
+</fo:instream-foreign-object>
+      <fo:block>
+       Some block text to separate instream objects.
+      </fo:block>
+      <fo:block>
+       Some text before
+<fo:instream-foreign-object>
+<svg:svg width="20" height="20">
+  <svg:g style="fill:red; stroke:#000000">
+     <svg:rect x="0" y="0" width="15" height="15"/>
+     <svg:rect x="5" y="5" width="15" height="15"/>
+  </svg:g>
+</svg:svg>
+</fo:instream-foreign-object>
+       and some after the svg element.
+      </fo:block>
+      <fo:block>
+       A text line below the instream object.
+      </fo:block>
+      <fo:block>
+<fo:instream-foreign-object>
+<svg:svg width="250" height="50">
+  <svg:g style="fill:red; stroke:#000000">
+     <svg:rect x="0" y="0" width="15" height="15"/>
+     <svg:rect x="5" y="5" width="15" height="15"/>
+  </svg:g>
+    <svg:text x="10" y="30">SVG placed in a block</svg:text>
+</svg:svg>
+</fo:instream-foreign-object>
+      </fo:block>
+      <fo:block>
+       A text line below the block.
+      </fo:block>
+      <fo:block>
+       A text line with an instream foreign object that is before the line break.
+<fo:instream-foreign-object>
+<svg:svg width="50" height="50">
+  <svg:g style="fill:red; stroke:#000000">
+     <svg:rect x="0" y="0" width="15" height="15"/>
+     <svg:rect x="5" y="5" width="15" height="15"/>
+  </svg:g>
+     <svg:rect x="0" y="0" width="49" height="49"/>
+</svg:svg>
+</fo:instream-foreign-object>
+With some text on the next line. With a bit more text to go over the to the next line.
+      </fo:block>
+      <fo:block>
+       A text line with an instream foreign object that is after the line break.
+With some text on the next line. With a bit
+<fo:instream-foreign-object>
+<svg:svg width="50" height="50">
+  <svg:g style="fill:red; stroke:#000000">
+     <svg:rect x="0" y="0" width="15" height="15"/>
+     <svg:rect x="5" y="5" width="15" height="15"/>
+  </svg:g>
+     <svg:rect x="0" y="0" width="49" height="49"/>
+</svg:svg>
+</fo:instream-foreign-object>
+more text to go over the to the next line.
+      </fo:block>
+      <fo:block>
+       A text line with an instream foreign object that is over the line break.
+With some text
+<fo:instream-foreign-object>
+<svg:svg width="50" height="50">
+  <svg:g style="fill:red; stroke:#000000">
+     <svg:rect x="0" y="0" width="15" height="15"/>
+     <svg:rect x="5" y="5" width="15" height="15"/>
+  </svg:g>
+     <svg:rect x="0" y="0" width="49" height="49"/>
+</svg:svg>
+</fo:instream-foreign-object>
+on the next line. With a bit more text to go over the to the next line to
+see it handles it properly.
+      </fo:block>
+      <fo:block>
+          The next block has an instream object wider than the area.
+      </fo:block>
+      <fo:block>
+<fo:instream-foreign-object>
+<svg:svg width="550" height="50">
+  <svg:g style="fill:red; stroke:#000000">
+     <svg:rect x="0" y="0" width="15" height="15"/>
+     <svg:rect x="5" y="5" width="15" height="15"/>
+  </svg:g>
+     <svg:rect x="0" y="0" width="549" height="49"/>
+    <svg:text x="10" y="30">SVG placed in a really wide block</svg:text>
+</svg:svg>
+</fo:instream-foreign-object>
+      </fo:block>
+      <fo:block>
+          This block has an instream object wider than the area after this text
+<fo:instream-foreign-object>
+<svg:svg width="550" height="50">
+  <svg:g style="fill:red; stroke:#000000">
+     <svg:rect x="0" y="0" width="15" height="15"/>
+     <svg:rect x="5" y="5" width="15" height="15"/>
+  </svg:g>
+     <svg:rect x="0" y="0" width="549" height="49"/>
+    <svg:text x="10" y="30">SVG placed in a really wide block</svg:text>
+</svg:svg>
+</fo:instream-foreign-object>
+      </fo:block>
+    </fo:flow>
+  </fo:page-sequence>
+</fo:root>