next up previous contents index
Next: Keyboard Up: Main Functions 1 Previous: Graphics   Contents   Index

Hard Copy

The following functions provide an interface for plot and graphical file output. This is completely outside of the normal printing interface.

(stringlist_handle) HClistDrivers()
This function returns a handle to a list of available printer drivers. The returned handle can be processed by any of the functions that operate on stringlist handles.

(int) HCsetDriver(driver)
This function will set the current print driver to the name passed (as a string). The name must be one of the internal driver names as returned from HClistDrivers. If the operation succeeds, the function returns 1, otherwise 0 is returned.

(string) HCgetDriver()
This function returns the internal name of the current driver. If no driver has been set, a null string is returned.

(int) HCsetResol(resol)
This function will set the resolution of the current driver to the value passed. The scalar argument should be one of the values supported by the driver, as returned from HCgetResols. If the resolution is set successfully, 1 is returned. If no driver has been set, or the driver does not support the given resolution, 0 is returned.

(int) HCgetResol()
This function returns the resolution set for the current driver, or 0 if no driver has been set or the driver does not provide settable resolutions.

(int) HCgetResols(array)
This function sets the array values to the resolutions supported by the current driver. The array must have size 8 or larger. The return value is the number of resolutions supported. If no driver has been set, or the driver has fixed resolution, 0 is returned.

(int) HCsetBestFit(best_fit)
This function will set or reset the ``best fit'' flag for the current driver. In best fit mode, the image will be rotated 90 degrees if this is a better match to the aspect ratio of the rendering area. If the operation succeeds, 1 is returned. If there is no driver set or the driver does not allow best fit mode, 0 is returned. If the argument is nonzero, best fit mode will be set if possible, otherwise the mode is unset.

(int) HCgetBestFit()
This function returns 1 if the current driver is in ``best fit'' mode, 0 otherwise.

(int) HCsetLegend(legend)
This function will set or reset the ``legend'' flag for the current driver. If set, a legend will be shown with the rendered image. If the operation succeeds, 1 is returned. If there is no driver set or the driver does not allow a legend, 0 is returned. If the argument is nonzero, the legend mode will be set if possible, otherwise the mode is unset.

(int) HCgetLegend()
This function returns 1 if the current driver has the ``legend'' mode set, 0 otherwise.

(int) HCsetLandscape(landscape)
This function will set or reset the ``landscape'' flag for the current driver. If set, the image will be rotated 90 degrees. If the operation succeeds, 1 is returned. If there is no driver set or the driver does not allow landscape mode, 0 is returned. If the argument is nonzero, the landscape mode will be set if possible, otherwise the mode is unset.

(int) HCgetLandscape()
This function returns 1 if the current driver has the ``landscape'' mode set, 0 otherwise.

(int) HCsetMetric(metric)
This function sets a flag in the current driver which indicates that the rendering area is given in millimeters. If not set, the values are taken in inches. This pertains to the values passed to the HCsetSize function. If the operation succeeds, 1 is returned. If there is no driver set, 0 is returned. If the argument is nonzero, the metric mode will be set if possible, otherwise the mode is unset.

(int) HCgetMetric()
This function returns 1 if the current driver has the ``metric'' mode set, 0 otherwise.

(int) HCsetSize(x, y, w, h)
This function sets the size and offset of the rendering area. The numbers correspond to the entries in the Print Control Panel. The values are scalars, in inches unless metric mode is in effect (with HCsetMetric) in which case the values are in millimeters. The values are clipped to the limits provided in the technology file. Most drivers accept 0 for one of w, h, indicating auto dimensioning mode. The function returns 1 on success, 0 if no driver has been set. Not all drivers use all four parameters, unused parameters are ignored.

(int) HCgetSize(array)
This function returns the rendering area parameters for the current driver. The array argument must have size 4 or larger. The values are returned in the order x, y, w, h. If the function succeeds, the values are set in the array and 1 is returned. Otherwise, 0 is returned.

(int) HCshowAxes(style)
This function sets the style or visibility of axes shown in plots of physical data (electrical plots never include axes). The argument is an integer 0-2, where 0 suppresses drawing of axes, 1 indicates plain axes, and 2 (or anything else) indicates axes with a box at the origin. The return value is the previous setting.

(int) HCshowGrid(show, mode)
This function determines whether or not the grid is shown in plots. If the first argument is nonzero, the grid will be shown, otherwise the grid will not be shown. The second argument indicates the type of data affected: zero for physical data, nonzero for electrical data. The return value is the previous setting.

(int) HCsetGridInterval(spacing, mode)
This function sets the grid spacing used in plots. The first argument is the interval in microns. The second argument indicates the type of data affected: zero for physical data, nonzero for electrical data. For electrical data, the spacing in microns is rather meaningless, except as being relative to the default which is 1.0. The return value is the previous setting.

(int) HCsetGridStyle(linemod, mode)
This function sets the line style used for the grid lines in plots. The first argument is an integer mask that defines the on-off pattern. The pattern starts at the most significant `1' bit and continues through the least significant bit, and repeats. Set bits are rendered as the visible part of the pattern. If the style is 0, a dot is shown at each grid point. Passing -1 will give continuous lines. The second argument indicates the type of data affected: zero for physical data, nonzero for electrical data. The return value is the previous setting.

(int) HCsetGridCrossSize(xsize, mode)
This applies only to grids with style 0 (dot grid). The xsize is an integer 0-6 which indicates the number of pixels to draw in the four compass directions around the central pixel. Thus, for nonzero values, the ``dot'' is rendered as a small cross. The second argument indicates the type of data affected: zero for physical data, nonzero for electrical data. The return value is 1 if the cross size was set, 0 if the grid style was nonzero in which case the cross size was not set.

(int) HCsetGridOnTop(on_top, mode)
This function sets whether the grid lines are drawn after the geometry (``on top'') or before the geometry. If the first argument is nonzero, the grid will be rendered on top. The second argument indicates the type of data affected: zero for physical data, nonzero for electrical data. The return value is the previous setting.

(int) HCdump(l, b, r, t, filename, command)
This is the function which actually generates a plot or graphics file. The first four arguments set the area in microns in current cell coordinates to render. If these values are all 0, a full view of the current cell will be rendered. The next argument is the name of the file to use for the graphical output. If this string is null or empty, a temporary file will be used. Under Windows, the final argument is the name of a printer, as known to the operating system. These names can be obtained with HClistPrinters. Under Unix/Linux, the last argument is a command string that will be executed to generate a plot. In any case if this argument is null or empty, the plot file will be generated, but no further action will be taken. In the command string, the character sequence ``%s'' will be replaced by the file name. If the sequence does not appear, the file name will be appended. If successful, 1 is returned, otherwise 0 is returned, and an error message can be obtained with HCerrorString.

The filename, or the temporary file that is used if no filename is given, is not removed. The user must remove the file explicitly.

The Windows Native driver (Windows only) has slightly different behavior. For this driver, the command string must specify a printer name, and can not be null or empty. If filename is not null or empty, the output goes to that file and is not sent to the printer. Otherwise, the output goes to the printer.

(int) HCerrorString()
This function returns a string indicating the error generated by HCdump. If there were no errors, a null string is returned.

(stringlist_handle) HClistPrinters()
Under Microsoft Windows, this function returns a handle to a list of printer names available from the current host. The first name is the name of the default printer. The remaining names, alphabetized, follow. If there are no printers available, or if not running under Windows, the function returns 0. The returned names can be supplied to the HCdump function to initiate a print job.

(int) HCmedia()
This function sets the media index, which is used by the Windows Native driver under Microsoft Windows only. The media index sets the assumed paper size. The argument is one of the integers from the table below. The page dimensions are in points (1/72 inch).

Index Name Width Height
0 Letter 612 792
1 Legal 612 1008
2 Tabloid 792 1224
3 Ledger 1224 792
4 10x14 720 1008
5 11x17 792 1224
6 12x18 864 1296
7 17x22 ``C'' 1224 1584
8 18x24 1296 1728
9 22x34 ``D'' 1584 2448
10 24x36 1728 2592
11 30x42 2160 3024
12 34x44 ``E'' 2448 3168
13 36x48 2592 3456
14 Statement 396 612
15 Executive 540 720
16 Folio 612 936
17 Quarto 610 780
18 A0 2384 3370
19 A1 1684 2384
20 A2 1190 1684
21 A3 842 1190
22 A4 595 842
23 A5 420 595
24 A6 298 420
25 B0 2835 4008
26 B1 2004 2835
27 B2 1417 2004
28 B3 1001 1417
29 B4 729 1032
30 B5 516 729

The returned value is the previous setting of the media index.


next up previous contents index
Next: Keyboard Up: Main Functions 1 Previous: Graphics   Contents   Index
Stephen R. Whiteley 2022-05-28