summaryrefslogtreecommitdiffstats
path: root/svgbob/examples
diff options
context:
space:
mode:
authorJovansonlee Cesar <ivanceras@gmail.com>2018-02-19 02:40:58 +0800
committerJovansonlee Cesar <ivanceras@gmail.com>2018-02-19 02:40:58 +0800
commit205d146b3338f11d7e765cfa7306e4c03d9bf3a5 (patch)
treecaf6a4f4f0ac33543f53af660e95b7c0d0ef3f5f /svgbob/examples
parent8d3faa0e4934b1e5e553c43fb4606122bfc775f0 (diff)
Added example to issue19
Diffstat (limited to 'svgbob/examples')
-rw-r--r--svgbob/examples/issue19.rs28
-rw-r--r--svgbob/examples/issue19.svg66
2 files changed, 94 insertions, 0 deletions
diff --git a/svgbob/examples/issue19.rs b/svgbob/examples/issue19.rs
new file mode 100644
index 0000000..69a6920
--- /dev/null
+++ b/svgbob/examples/issue19.rs
@@ -0,0 +1,28 @@
+
+extern crate svgbob;
+extern crate svg;
+
+use svgbob::Grid;
+use svgbob::Settings;
+
+
+fn main() {
+ let file = "examples/issue19.svg";
+ let arg = r#"
+
+Issue 19 demo test -------
+
+ +-----------+---+
+ | "a.to(b)" | c |
+ +-----------+---+
+
+ +-----------+---+
+ | "a.to(b)" | c |""
+ +-----------+---+
+ "#;
+ let g = Grid::from_str(arg, &Settings::compact());
+ let svg = g.get_svg();
+ svg::save(file, &svg).unwrap();
+ println!("Saved to {}",file);
+}
+
diff --git a/svgbob/examples/issue19.svg b/svgbob/examples/issue19.svg
new file mode 100644
index 0000000..db1e75a
--- /dev/null
+++ b/svgbob/examples/issue19.svg
@@ -0,0 +1,66 @@
+<svg class="bob" font-family="arial" font-size="14" height="192" width="216" xmlns="http://www.w3.org/2000/svg">
+<defs>
+<marker id="triangle" markerHeight="10" markerUnits="strokeWidth" markerWidth="10" orient="auto" refX="15" refY="10" viewBox="0 0 50 20">
+<path d="M 0 0 L 30 10 L 0 20 z"/>
+</marker>
+</defs>
+<style>
+
+ line, path {
+ stroke: black;
+ stroke-width: 2;
+ stroke-opacity: 1;
+ fill-opacity: 1;
+ stroke-linecap: round;
+ stroke-linejoin: miter;
+ }
+ circle {
+ stroke: black;
+ stroke-width: 2;
+ stroke-opacity: 1;
+ fill-opacity: 1;
+ stroke-linecap: round;
+ stroke-linejoin: miter;
+ }
+ circle.solid {
+ fill:black;
+ }
+ circle.open {
+ fill:transparent;
+ }
+ tspan.head{
+ fill: none;
+ stroke: none;
+ }
+
+</style>
+<path d=" M 160 40 L 168 40 M 160 40 L 168 40 L 176 40 M 168 40 L 176 40 L 184 40 M 176 40 L 184 40 L 192 40 M 184 40 L 192 40 L 200 40 M 192 40 L 200 40 L 208 40 M 200 40 L 208 40 L 216 40 M 208 40 L 216 40 M 36 72 L 40 72 M 36 72 L 36 80 M 40 72 L 48 72 M 40 72 L 48 72 L 56 72 M 48 72 L 56 72 L 64 72 M 56 72 L 64 72 L 72 72 M 64 72 L 72 72 L 80 72 M 72 72 L 80 72 L 88 72 M 80 72 L 88 72 L 96 72 M 88 72 L 96 72 L 104 72 M 96 72 L 104 72 L 112 72 M 104 72 L 112 72 L 120 72 M 112 72 L 120 72 L 128 72 M 120 72 L 128 72 M 132 72 L 128 72 M 132 72 L 136 72 M 132 72 L 132 80 M 136 72 L 144 72 M 136 72 L 144 72 L 152 72 M 144 72 L 152 72 L 160 72 M 152 72 L 160 72 M 164 72 L 160 72 M 164 72 L 164 80 M 36 80 L 36 96 M 36 80 L 36 96 M 132 80 L 132 96 M 132 80 L 132 96 M 164 80 L 164 96 M 164 80 L 164 96 M 36 104 L 36 96 M 36 104 L 40 104 L 48 104 M 40 104 L 48 104 L 56 104 M 48 104 L 56 104 L 64 104 M 56 104 L 64 104 L 72 104 M 64 104 L 72 104 L 80 104 M 72 104 L 80 104 L 88 104 M 80 104 L 88 104 L 96 104 M 88 104 L 96 104 L 104 104 M 96 104 L 104 104 L 112 104 M 104 104 L 112 104 L 120 104 M 112 104 L 120 104 L 128 104 M 120 104 L 128 104 M 132 104 L 132 96 M 132 104 L 128 104 M 132 104 L 136 104 L 144 104 M 136 104 L 144 104 L 152 104 M 144 104 L 152 104 L 160 104 M 152 104 L 160 104 M 164 104 L 164 96 M 164 104 L 160 104 M 36 136 L 40 136 M 36 136 L 36 144 M 40 136 L 48 136 M 40 136 L 48 136 L 56 136 M 48 136 L 56 136 L 64 136 M 56 136 L 64 136 L 72 136 M 64 136 L 72 136 L 80 136 M 72 136 L 80 136 L 88 136 M 80 136 L 88 136 L 96 136 M 88 136 L 96 136 L 104 136 M 96 136 L 104 136 L 112 136 M 104 136 L 112 136 L 120 136 M 112 136 L 120 136 L 128 136 M 120 136 L 128 136 M 132 136 L 128 136 M 132 136 L 136 136 M 132 136 L 132 144 M 136 136 L 144 136 M 136 136 L 144 136 L 152 136 M 144 136 L 152 136 L 160 136 M 152 136 L 160 136 M 164 136 L 160 136 M 164 136 L 164 144 M 36 144 L 36 160 M 36 144 L 36 160 M 132 144 L 132 160 M 132 144 L 132 160 M 164 144 L 164 160 M 164 144 L 164 160 M 36 168 L 36 160 M 36 168 L 40 168 L 48 168 M 40 168 L 48 168 L 56 168 M 48 168 L 56 168 L 64 168 M 56 168 L 64 168 L 72 168 M 64 168 L 72 168 L 80 168 M 72 168 L 80 168 L 88 168 M 80 168 L 88 168 L 96 168 M 88 168 L 96 168 L 104 168 M 96 168 L 104 168 L 112 168 M 104 168 L 112 168 L 120 168 M 112 168 L 120 168 L 128 168 M 120 168 L 128 168 M 132 168 L 132 160 M 132 168 L 128 168 M 132 168 L 136 168 L 144 168 M 136 168 L 144 168 L 152 168 M 144 168 L 152 168 L 160 168 M 152 168 L 160 168 M 164 168 L 164 160 M 164 168 L 160 168" fill="none"/>
+<path d="" fill="none" stroke-dasharray="3 3"/>
+<text x="1" y="44">
+Issue
+</text>
+<text x="49" y="44">
+19
+</text>
+<text x="73" y="44">
+demo
+</text>
+<text x="113" y="44">
+test
+</text>
+<text x="145" y="92">
+c
+</text>
+<text x="145" y="156">
+c
+</text>
+<text x="49" y="92">
+a.to(b)
+</text>
+<text x="49" y="156">
+a.to(b)
+</text>
+<text x="169" y="156">
+
+</text>
+</svg> \ No newline at end of file