![]() |
CAIROName:
Cairo is designed to produce consistent output on all output media while taking advantage of display hardware acceleration when available (for example, through the X Render Extension). The cairo API provides operations similar to the drawing operators of PostScript and PDF. Operations in cairo include stroking and filling cubic Bézier splines, transforming and compositing translucent images, and antialiased text rendering. All drawing operations can be transformed by any affine transformation (scale, rotation, shear, etc.). Cairo has been designed to let you draw anything you want in a modern 2D graphical user interface. At the same time, the cairo API has been designed to be as fun and easy to learn as possible. Dataplot currently supports Cairo for the Unix/Linux environment. The following Cairo devices are supported
Postscript Encapsulated Postscript PDF (Portable Document Format) SVG (Scalable Vector Graphics) PNG (Portable Network Graphics) Note that with the exception of the PDF device, Dataplot has native support for these devices. One advantage of using Cairo is that the output is more consistent across the various devices. Specifically, using Cairo the output generated to the screen via X11 will be more consistent with the output generated to Postscript or PDF. This is particularly the case for hardware text. Also, the Cairo PNG device generates better output than the GD PNG device. The Quartz device for the Mac OS X environment and the WIN32 device for the Windows environment are currently under development.
This form designates device 1 (the terminal) as a X11 device. Currently, only the X11 device supports graphics to the terminal. An error message is generated if you specify one of the other supported Cairo devices for DEVICE 1.
DEVICE 2 and DEVICE 3 generate graphics to a file. This command is most typically used for DEVICE 2. X11 is not supported for DEVICE 2 or DEVICE 3.
DEVICE 2 CAIRO POSTSCRIPT DEVICE 2 CAIRO SVG DEVICE 3 CAIRO PDF DEVICE 2 CAIRO POSTSCRIPT ENCAPSULATED
DEVICE 2 CAIRO PNG ... Generate first plot .. DEVICE 2 CLOSE . SET IPL1NA PLOT2.PNG DEVICE 2 CAIRO PNG ... Generate second plot .. DEVICE 2 CLOSE The SET IPL1NA command is used to give the plot file a unique name. This basic sequence can be repeated as often as needed. If you try to generate multiple plots for these devices, the results will not be good (basically, the plots will be overlaid on a single page). The Postscript and PDF devices support multiple plots per file.
To specify the font for the Cairo device, enter the command
where <name> specifies the desired font. Up to 32 characters are allowed for the font name. The available fonts will vary on a specific platform, so no listing (or checking within Dataplot) is provided. The basic fonts such as Sans or Serif should be available on just about all installations. If you use a common font name such as Arial or Helvetica (or Courier for when you need a fixed space font), it should be available on most installations. The following additional font related commands are supported
SET CAIRO FONT SLANT <NORMAL/ITALIC> These commands allow you to specify bold or italic text. NORMAL is the default for both of these commands. The following commands are used to specify characteristics for drawing lines
SET CAIRO JOIN <MITER/ROUND/BEVEL/NONE> BUTT and MITER are the defaults. By default, region fills are performed in hardware (i.e., by Cairo). Although this is generally faster, hardware fills can occassionally generate unintended results. To specify region fills be generated in software, use the command
2023/11: Made several bug fixes SET IPL1NA PLOT1.PDF DEVICE 2 CAIRO PDF PLOT X**2 FOR X = 1 1 9 DEVICE 2 CLOSE SET IPL1NA PLOT2.PDF DEVICE 2 CAIRO PDF PLOT X**3 FOR X = 1 1 9 DEVICE 2 CLOSE
Date created: 11/07/2017 |
Last updated: 11/03/2023 Please email comments on this WWW page to alan.heckert@nist.gov. |