func NewPSSurface(filename string, widthInPoints, heightInPoints float64, level PSLevel) *Surface { cs := C.CString(filename) defer C.free(unsafe.Pointer(cs)) s := C.cairo_ps_surface_create(cs, C.double(widthInPoints), C.double(heightInPoints)) C.cairo_ps_surface_restrict_to_level(s, C.cairo_ps_level_t(level)) return &Surface{surface: s, context: C.cairo_create(s)} }
//RestrictTo restricts the generated PostScript to the specified level. //The default is Level3. // //This method should only be called before any drawing operations have been //performed on this surface. // //Originally cairo_ps_surface_restrict_to_level. func (s Surface) RestrictTo(level level) error { C.cairo_ps_surface_restrict_to_level(s.XtensionRaw(), level.c()) return s.Err() }