2015-07-10 13:11:19 +00:00
|
|
|
// Copyright 2015 The draw2d Authors. All rights reserved.
|
|
|
|
// created: 26/06/2015 by Stani Michiels
|
2015-07-01 08:34:23 +00:00
|
|
|
// See also test_test.go
|
|
|
|
|
2015-07-06 22:25:24 +00:00
|
|
|
package draw2dpdf_test
|
2015-06-30 23:11:20 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2016-12-13 14:35:47 +00:00
|
|
|
"gopkg.in/llgcode/draw2d.v1"
|
|
|
|
"gopkg.in/llgcode/draw2d.v1/samples/android"
|
|
|
|
"gopkg.in/llgcode/draw2d.v1/samples/frameimage"
|
|
|
|
"gopkg.in/llgcode/draw2d.v1/samples/geometry"
|
|
|
|
"gopkg.in/llgcode/draw2d.v1/samples/gopher"
|
|
|
|
"gopkg.in/llgcode/draw2d.v1/samples/gopher2"
|
|
|
|
"gopkg.in/llgcode/draw2d.v1/samples/helloworld"
|
|
|
|
"gopkg.in/llgcode/draw2d.v1/samples/line"
|
|
|
|
"gopkg.in/llgcode/draw2d.v1/samples/linecapjoin"
|
|
|
|
"gopkg.in/llgcode/draw2d.v1/samples/postscript"
|
2015-06-30 23:11:20 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestSampleAndroid(t *testing.T) {
|
|
|
|
test(t, android.Main)
|
|
|
|
}
|
|
|
|
|
2015-07-11 16:44:36 +00:00
|
|
|
// TODO: FillString: w (width) is incorrect
|
|
|
|
func TestSampleGeometry(t *testing.T) {
|
|
|
|
// Set the global folder for searching fonts
|
|
|
|
// The pdf backend needs for every ttf file its corresponding
|
|
|
|
// json/.z file which is generated by gofpdf/makefont.
|
|
|
|
draw2d.SetFontFolder("../resource/font")
|
|
|
|
test(t, geometry.Main)
|
|
|
|
}
|
|
|
|
|
2015-06-30 23:11:20 +00:00
|
|
|
func TestSampleGopher(t *testing.T) {
|
|
|
|
test(t, gopher.Main)
|
|
|
|
}
|
|
|
|
|
2015-07-11 16:44:36 +00:00
|
|
|
func TestSampleGopher2(t *testing.T) {
|
|
|
|
test(t, gopher2.Main)
|
|
|
|
}
|
|
|
|
|
2015-06-30 23:11:20 +00:00
|
|
|
func TestSampleHelloWorld(t *testing.T) {
|
|
|
|
// Set the global folder for searching fonts
|
2015-07-10 00:07:18 +00:00
|
|
|
// The pdf backend needs for every ttf file its corresponding
|
|
|
|
// json/.z file which is generated by gofpdf/makefont.
|
|
|
|
draw2d.SetFontFolder("../resource/font")
|
2015-06-30 23:11:20 +00:00
|
|
|
test(t, helloworld.Main)
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestSampleFrameImage(t *testing.T) {
|
|
|
|
test(t, frameimage.Main)
|
|
|
|
}
|
2015-07-01 08:34:23 +00:00
|
|
|
|
|
|
|
func TestSampleLine(t *testing.T) {
|
|
|
|
test(t, line.Main)
|
|
|
|
}
|
2015-07-01 12:44:51 +00:00
|
|
|
|
|
|
|
func TestSampleLineCap(t *testing.T) {
|
|
|
|
test(t, linecapjoin.Main)
|
|
|
|
}
|
2015-07-01 13:15:37 +00:00
|
|
|
|
|
|
|
func TestSamplePostscript(t *testing.T) {
|
|
|
|
test(t, postscript.Main)
|
|
|
|
}
|