Package: cairo

Function cairo:surface-fallback-resolution

Lambda List

cairo:surface-fallback-resolution (surface)

Syntax

(cairo:surface-fallback-resolution surface) => xpixels, ypixels
(setf (cairo:surface-fallback-resolution surface) (list xpixels ypixels))

Arguments

surface -- a cairo:surface-t instance
xpixels -- a number coerced to a double float for the horizontal pixels per inch
ypixels -- a number coerced to a double float for the vertical pixels per inch

Details

The cairo:surface-fallback-resolution function returns the fallback resolution, or default fallback resolution if never set. The (setf cairo:surface-fallback-resolution) function sets the horizontal and vertical resolution for image fallbacks.

When certain operations are not supported natively by a backend, Cairo will fallback by rendering operations to an image and then overlaying that image onto the output. For backends that are natively vector-oriented, this function can be used to set the resolution used for these image fallbacks. Larger values will result in more detailed images, but also larger file sizes.

Some examples of natively vector-oriented backends are the ps, pdf, and svg backends.

For backends that are natively raster-oriented, image fallbacks are still possible, but they are always performed at the native device resolution. So this function has no effect on those backends.

The default fallback resoultion is 300 pixels per inch in both dimensions.

Notes

The fallback resolution only takes effect at the time of completing a page with the cairo:show-page or cairo:copy-page functions so there is currently no way to have more than one fallback resolution in effect on a single page.
 

See also

2025-1-18