diff --git a/README.md b/README.md index 0a6027a..31b1091 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,11 @@ draw2d ====== -Package draw2d is a pure [go](http://golang.org) 2D vector graphics library with support for multiple output devices such as [images](http://golang.org/pkg/image) (draw2d), pdf documents (draw2dpdf) and opengl (draw2dopengl), which can also be used on the google app engine. It can be used as a pure go [Cairo](http://www.cairographics.org/) alternative. draw2d is released under the BSD license. +Package draw2d is a pure [go](http://golang.org) 2D vector graphics library with support for multiple output devices such as [images](http://golang.org/pkg/image) (draw2d), pdf documents (draw2dpdf) and opengl (draw2dopengl), which can also be used on the google app engine. It can be used as a pure go [Cairo](http://www.cairographics.org/) alternative. draw2d is released under the BSD license. See the [documentation](http://godoc.org/github.com/llgcode/draw2d) for more details. -See the [documentation](http://godoc.org/github.com/llgcode/draw2d) for more details. +[![geometry](https://raw.githubusercontent.com/llgcode/draw2d/master/output/samples/geometry.png)](https://raw.githubusercontent.com/llgcode/draw2d/master/resource/image/geometry.pdf)[![postscript](https://raw.githubusercontent.com/llgcode/draw2d/master/output/samples/postscript.png)](https://raw.githubusercontent.com/llgcode/draw2d/master/resource/image/postscript.pdf) -[![demonstration of the image backend](https://raw.githubusercontent.com/llgcode/draw2d/master/output/samples/geometry.png)](https://raw.githubusercontent.com/llgcode/draw2d/master/output/samples/geometry.pdf) - -This image above is generated with the image backend. Click on the image to get the pdf which is generated with exactly the same code. +Click on an image above to get the pdf, generated with exactly the same draw2d code. The first image is the output of `samples/geometry`. The second image is the result of `samples/postcript`, which demonstrates that draw2d can draw postscript files into images or pdf documents with the [ps](https://github.com/llgcode/ps) package. Features -------- diff --git a/draw2dpdf/test_test.go b/draw2dpdf/test_test.go index 332f278..801ff36 100644 --- a/draw2dpdf/test_test.go +++ b/draw2dpdf/test_test.go @@ -7,7 +7,6 @@ package draw2dpdf_test import ( - "os" "testing" "github.com/llgcode/draw2d" @@ -26,13 +25,13 @@ func test(t *testing.T, draw sample) { t.Errorf("Drawing %q failed: %v", output, err) return } - - // Save to pdf only if it doesn't exist because of git - if _, err = os.Stat(output); err == nil { - t.Skipf("Saving %q skipped, as it exists already. (Git would consider it modified.)", output) - return - } - + /* + // Save to pdf only if it doesn't exist because of git + if _, err = os.Stat(output); err == nil { + t.Skipf("Saving %q skipped, as it exists already. (Git would consider it modified.)", output) + return + } + */ err = draw2dpdf.SaveToPdfFile(output, dest) if err != nil { t.Errorf("Saving %q failed: %v", output, err) diff --git a/output/samples/.gitignore b/output/samples/.gitignore index 1996c5a..e39d62f 100644 --- a/output/samples/.gitignore +++ b/output/samples/.gitignore @@ -2,4 +2,5 @@ * # Except this file !.gitignore -!geometry.* \ No newline at end of file +!geometry.png +!postscript.png \ No newline at end of file diff --git a/output/samples/postscript.png b/output/samples/postscript.png new file mode 100644 index 0000000..eca7808 Binary files /dev/null and b/output/samples/postscript.png differ diff --git a/output/samples/geometry.pdf b/resource/image/geometry.pdf similarity index 100% rename from output/samples/geometry.pdf rename to resource/image/geometry.pdf diff --git a/resource/image/postscript.pdf b/resource/image/postscript.pdf new file mode 100644 index 0000000..d4b60be Binary files /dev/null and b/resource/image/postscript.pdf differ