commit
5d7c08c52f
6 changed files with 12 additions and 14 deletions
|
@ -1,13 +1,11 @@
|
||||||
draw2d
|
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)
|
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.
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
Features
|
Features
|
||||||
--------
|
--------
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
package draw2dpdf_test
|
package draw2dpdf_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/llgcode/draw2d"
|
"github.com/llgcode/draw2d"
|
||||||
|
@ -26,13 +25,13 @@ func test(t *testing.T, draw sample) {
|
||||||
t.Errorf("Drawing %q failed: %v", output, err)
|
t.Errorf("Drawing %q failed: %v", output, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
// Save to pdf only if it doesn't exist because of git
|
// Save to pdf only if it doesn't exist because of git
|
||||||
if _, err = os.Stat(output); err == nil {
|
if _, err = os.Stat(output); err == nil {
|
||||||
t.Skipf("Saving %q skipped, as it exists already. (Git would consider it modified.)", output)
|
t.Skipf("Saving %q skipped, as it exists already. (Git would consider it modified.)", output)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
err = draw2dpdf.SaveToPdfFile(output, dest)
|
err = draw2dpdf.SaveToPdfFile(output, dest)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Saving %q failed: %v", output, err)
|
t.Errorf("Saving %q failed: %v", output, err)
|
||||||
|
|
3
output/samples/.gitignore
vendored
3
output/samples/.gitignore
vendored
|
@ -2,4 +2,5 @@
|
||||||
*
|
*
|
||||||
# Except this file
|
# Except this file
|
||||||
!.gitignore
|
!.gitignore
|
||||||
!geometry.*
|
!geometry.png
|
||||||
|
!postscript.png
|
BIN
output/samples/postscript.png
Normal file
BIN
output/samples/postscript.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 41 KiB |
BIN
resource/image/postscript.pdf
Normal file
BIN
resource/image/postscript.pdf
Normal file
Binary file not shown.
Loading…
Reference in a new issue