Example #1
0
func (s TEXTTestsSuite) Test_text2(c *C) {
	//c.Skip("Not now")

	obtained := cSL(`<text x="250" y="150" style="font-family:Verdana;font-size:55;fill:blue">Hello, out there</text>`)
	f := style.Font("font-family:Verdana;font-size:55")
	text := Text(style.Style().Fill("blue").Font(f))
	text = text.XY(250, 150).String("Hello, out there")
	res := text.Source()
	c.Assert(cSL(res), Equals, obtained)
}
Example #2
0
func (s TEXTTestsSuite) Test_Transform(c *C) {
	//c.Skip("Not now")

	obtained := cSL(`<text x="250" y="150" style="font-family:Verdana;font-size:55;fill:blue" transform="matrix(12.00, 34.00, 45.00, 34.50, 212.00, 4.45)">Hello, out there</text>`)
	f := style.Font("font-family:Verdana;font-size:55")
	text := Text(style.Style().Fill("blue").Font(f))
	text = text.XY(250, 150).String("Hello, out there")
	tr := transform.Transform().Matrix(12, 34, 45, 34.5, 212, 4.45)
	text = text.Transform(tr)
	res := text.Source()
	c.Assert(cSL(res), Equals, obtained)
}