#define DEFAULT_RANKSEP 0.5
#define MIN_RANKSEP 0.02
-/* default page size in points - including margins = 8.5in x 11in */
-#define DEFAULT_PAGEWD 612
-#define DEFAULT_PAGEHT 792
/* default margin for paged formats such as PostScript - in points = 0.5in */
#define DEFAULT_PRINT_MARGIN 36
/* default margin for embedded formats such as PNG - in points */
imageSize.x = MIN(imageSize.x, pageSize.x);
imageSize.y = MIN(imageSize.y, pageSize.y);
} else {
- /* page not set by user, assume default when centering,
- but allow infinite page for any other interpretation */
- pageSize.x = DEFAULT_PAGEWD - 2 * margin.x;
- pageSize.y = DEFAULT_PAGEHT - 2 * margin.y;
+ /* page not set by user, use default from renderer */
+ if (job->render.features) {
+ pageSize.x = job->render.features->default_pagesize.x - 2*margin.x;
+ if (pageSize.x < 0.)
+ pageSize.x = 0.;
+ pageSize.y = job->render.features->default_pagesize.y - 2*margin.y;
+ if (pageSize.y < 0.)
+ pageSize.y = 0.;
+ }
+ else
+ pageSize.x = pageSize.y = 0.;
job->pagesArraySize.x = job->pagesArraySize.y = job->numPages = 1;
}
int flags;
double default_margin; /* points */
double default_pad; /* graph units */
- point default_size; /* default height, width - device units */
+ pointf default_pagesize;/* default page width, height - points */
pointf default_dpi;
char **knowncolors;
int sz_knowncolors;
0, /* flags */
0., /* default margin - points */
0., /* default pad - graph units */
- {0,0}, /* default height, width - device units */
+ {0.,0.}, /* default page width, height - points */
{72.,72.}, /* default dpi */
NULL, /* knowncolors */
0, /* sizeof knowncolors */
| GVRENDER_Y_GOES_DOWN, /* flags */
DEFAULT_EMBED_MARGIN, /* default margin - points */
4., /* default pad - graph units */
- {0,0}, /* default height, width - device units */
+ {0.,0.}, /* default page width, height - points */
{1440.,1440.}, /* default dpi */
/* FIXME - this default dpi is a very strange number!!!
* It was picked to make .png usershapes the right size on my screen.
| GVRENDER_DOES_MAP_POLYGON,
0, /* default margin - points */
4., /* default pad - graph units */
- {0,0}, /* default height, width - device units */
+ {0.,0.}, /* default page width, height - points */
{96.,96.}, /* default dpi */
NULL, /* knowncolors */
0, /* sizeof knowncolors */
| GVRENDER_DOES_MAP_RECTANGLE,
0, /* default margin - points */
4., /* default pad - graph units */
- {0,0}, /* default height, width - device units */
+ {0.,0.}, /* default page width, height - points */
{96.,96.}, /* default dpi */
NULL, /* knowncolors */
0, /* sizeof knowncolors */
| GVRENDER_DOES_MAP_RECTANGLE,
36, /* default margin - points */
4., /* default pad - graph units */
- {0,0}, /* default height, width - device units */
+ {612.,792.}, /* default page width, height - points */
{72.,72.}, /* default dpi */
NULL, /* knowncolors */
0, /* sizeof knowncolors */
| GVRENDER_DOES_TOOLTIPS, /* flags */
DEFAULT_EMBED_MARGIN, /* default margin - points */
4., /* default pad - graph units */
- {0,0}, /* default height, width - device units */
+ {0.,0.}, /* default page width, height - points */
{96.,96.}, /* default dpi */
svg_knowncolors, /* knowncolors */
sizeof(svg_knowncolors) / sizeof(char *), /* sizeof knowncolors */
| GVRENDER_Y_GOES_DOWN, /* flags */
0, /* default margin - points */
4., /* default pad - graph units */
- {0,0}, /* default height, width - device units */
+ {0.,0.}, /* default page width, height - points */
{96.,96.}, /* default dpi */
NULL, /* knowncolors */
0, /* sizeof knowncolors */
GVRENDER_Y_GOES_DOWN, /* flags */
0, /* default margin - points */
4., /* default pad - graph units */
- {0,0}, /* default height, width - device units */
+ {0.,0.}, /* default page width, height - points */
{96.,96.}, /* default dpi */
NULL, /* knowncolors */
0, /* sizeof knowncolors */
GVRENDER_DOES_Z, /* flags */
0, /* default margin - points */
4., /* default pad - graph units */
- {0,0}, /* default height, width - device units */
+ {0.,0.}, /* default page width, height - points */
{72.,72.}, /* default dpi */
NULL, /* knowncolors */
0, /* sizeof knowncolors */
| GVRENDER_DOES_TRANSFORM, /* flags */
0, /* default margin - points */
4., /* default pad - graph units */
- {0,0}, /* default height, width - device units */
+ {0.,0.}, /* default page width, height - points */
{96.,96.}, /* default dpi */
0, /* knowncolors */
0, /* sizeof knowncolors */
| GVRENDER_DOES_TRANSFORM, /* flags */
36, /* default margin - points */
4., /* default pad - graph units */
- {0,0}, /* default height, width - device units */
+ {0.,0.}, /* default page width, height - points */
{72.,72.}, /* postscript 72 dpi */
0, /* knowncolors */
0, /* sizeof knowncolors */
| GVRENDER_X11_EVENTS, /* flags */
0, /* default margin - points */
4., /* default pad - graph units */
- {0,0}, /* default height, width - device units */
+ {0.,0.}, /* default page width, height - points */
{72.,72.}, /* default dpi */
0, /* knowncolors */
0, /* sizeof knowncolors */
| GVRENDER_X11_EVENTS, /* flags */
0, /* default margin - points */
4., /* default pad - graph units */
- {0,0}, /* default height, width - device units */
+ {0.,0.}, /* default page width, height - points */
{72.,72.}, /* default dpi */
0, /* knowncolors */
0, /* sizeof knowncolors */