示例#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)}
}
示例#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)
}
示例#3
0
文件: cairo.go 项目: mantyr/go-cairo
func (self SVGVersion) String() string {
	return C.GoString(C.cairo_svg_version_to_string(C.cairo_svg_version_t(self)))
}
示例#4
0
func (v version) c() C.cairo_svg_version_t {
	return C.cairo_svg_version_t(v)
}