.TH cairodriver 1grass "" "GRASS 7.8.5" "GRASS GIS User's Manual" .SH Cairo DISPLAY DRIVER \fICairo display driver\fR for bitmap or vector output using the Cairo graphics library. .SH DESCRIPTION The Cairo driver generates PNG, BMP, PPM, PS, PDF or SVG images by GRASS display commands, using the Cairo graphics library. The image format is selected from the extension of the output file. The Cairo driver is used for GRASS display commands by default if available, otherwise \fIPNG driver\fR is used. .SH USAGE .SS Environment variables The Cairo driver can be enabled by setting \fBGRASS_RENDER_IMMEDIATE\fR variable, eg. .br .nf \fC export GRASS_RENDER_IMMEDIATE=cairo \fR .fi Several environment variables affect the operation of the Cairo driver: .RS 4n .IP \(bu 4n \fBGRASS_RENDER_WIDTH=xxx\fR .br the width of the image map (default is 640). .IP \(bu 4n \fBGRASS_RENDER_HEIGHT=yyy\fR .br the height of the image map (default is 480). .IP \(bu 4n \fBGRASS_RENDER_BACKGROUNDCOLOR=RRGGBB\fR .br specifies the background color to use in RGB notation (hex or R:G:B values). Named colors are also supported. Default is \fBFFFFFF\fR (white). .IP \(bu 4n \fBGRASS_RENDER_TRANSPARENT=[TRUE|FALSE]\fR .br sets transparent background on (TRUE) or off (FALSE, default). .IP \(bu 4n \fBGRASS_RENDER_ANTIALIAS\fR .br can be \fIdefault\fR, \fInone\fR, \fIgray\fR, or \fIsubpixel\fR, corresponding to cairo_antialias_t .IP \(bu 4n \fBGRASS_RENDER_FILE=filename\fR .br the name and format of the resulting image file, default is map.png. .br The image format is determined from the file extension. .br Supported bitmap formats: .RS 4n .IP \(bu 4n \fB.png\fR \- Portable Network Graphics (PNG) .IP \(bu 4n \fB.bmp\fR \- Windows Bitmap (BMP, 32\-bpp) (these are not readable by some older viewers) .IP \(bu 4n \fB.ppm\fR \- Portable Pixmap (PPM + PGM for alpha channel) .RE Supported vector formats: .RS 4n .IP \(bu 4n \fB.pdf\fR \- Portable Document Format (PDF) .IP \(bu 4n \fB.ps\fR \- PostScript (PS) .IP \(bu 4n \fB.svg\fR \- Scalable Vector Graphics (SVG) .RE (Note: Some formats may not be available, depending on your platform and the Cairo library that GRASS was built with.) .IP \(bu 4n \fBGRASS_RENDER_FILE_READ\fR .br if TRUE, the Cairo driver will initialize the image from the contents of GRASS_RENDER_FILE. .br (\fINote: This is only supported for bitmap formats\fR) .IP \(bu 4n \fBGRASS_RENDER_FILE_MAPPED\fR .br if TRUE, the Cairo driver will map GRASS_RENDER_FILE as its framebuffer, rather than using memory. .br (\fINote: This only works with BMP files.\fR) .IP \(bu 4n \fBGRASS_RENDER_CAIRO_SCREEN\fR .br defines Cairo screen .IP \(bu 4n \fBGRASS_RENDER_CAIRO_VISUAL\fR .br defines Cairo visual .RE .SH EXAMPLES .SS PNG Example Example: using the driver to generate a PNG file (bash\-syntax): .br .nf \fC export GRASS_RENDER_IMMEDIATE=cairo export GRASS_RENDER_FILE=nc_spm.png export GRASS_RENDER_WIDTH=800 export GRASS_RENDER_HEIGHT=800 export GRASS_RENDER_FILE_READ=TRUE g.region raster=elevation d.rast map=elevation d.vect map=streams width=1 color=blue fcolor=aqua type=area,line d.vect map=roadsmajor width=2 \fR .fi .SS PDF Examples Example: using the driver to generate a PDF vector file with a vector map (bash\-syntax): .br .nf \fC export GRASS_RENDER_IMMEDIATE=cairo export GRASS_RENDER_FILE=nc_spm.pdf export GRASS_RENDER_WIDTH=800 export GRASS_RENDER_HEIGHT=800 g.region vector=roadsmajor # activate vector font d.font Vera d.vect map=roadsmajor layer=1 display=shape attrcolumn=ROAD_NAME lcolor=0:90:255 \fR .fi .PP Example: using the driver to generate a PDF raster file with a raster map (bash\-syntax): .br .nf \fC export GRASS_RENDER_IMMEDIATE=cairo export GRASS_RENDER_FILE=nc_spm.pdf export GRASS_RENDER_WIDTH=800 export GRASS_RENDER_HEIGHT=800 g.region raster=elevation d.rast map=elevation \fR .fi .SS SVG Example Example: using the driver to generate a SVG vector file with a vector map (bash\-syntax): .br .nf \fC export GRASS_RENDER_IMMEDIATE=cairo export GRASS_RENDER_FILE=vectormap.svg g.region vector=roadsmajor d.vect map=roadsmajor \-c \fR .fi .SH NOTES The driver is still in development. Enable it by specifying \fC\-\-with\-cairo\fR when configuring GRASS. This requires a reasonably recent version of the Cairo libraries and a working pkg\-config. .PP Antialiasing is enabled by default for bitmap formats. There is currently no way of disabling this. .PP The resolution of the output images is defined by current region extents. Use g.region \-p to get the number of rows and cols and use the environment variables to set the image size. If you would like a larger image, multiply both rows and cols by the same whole number to preserve the aspect ratio. .PP Cairo supports true vector format output whenever possible. However, if the selected format doesn\(cqt support a necessary feature, Cairo may fall back on rendering a bitmap representation of the image wrapped in the selected vector format. .SH SEE ALSO \fI PNG driver, PS driver, HTML driver, variables \fR .PP \fI d.rast, d.vect, d.mon, d.erase, d.redraw \fR .SH AUTHOR Lars Ahlzen <\fIlars (at) ahlzen.com\fR> .br and the GRASS Development Team. .PP Main index | Topics index | Keywords index | Graphical index | Full index .PP © 2003\-2020 GRASS Development Team, GRASS GIS 7.8.5 Reference Manual