Exemplo n.º 1
0
func NewSVGSurface(filename string, widthInPoints, heightInPoints float64, version SVGVersion) *Surface {
	cs := C.CString(filename)
	defer C.free(unsafe.Pointer(cs))
	s := C.cairo_svg_surface_create(cs, C.double(widthInPoints), C.double(heightInPoints))
	C.cairo_svg_surface_restrict_to_version(s, C.cairo_svg_version_t(version))
	return &Surface{surface: s, context: C.cairo_create(s)}
}
Exemplo n.º 2
0
func (v version) String() string {
	V := C.cairo_svg_version_to_string(C.cairo_svg_version_t(v))
	if V == nil {
		return "unknown SVG version"
	}
	return C.GoString(V)
}
Exemplo n.º 3
0
func (self SVGVersion) String() string {
	return C.GoString(C.cairo_svg_version_to_string(C.cairo_svg_version_t(self)))
}
Exemplo n.º 4
0
func (v version) c() C.cairo_svg_version_t {
	return C.cairo_svg_version_t(v)
}