home *** CD-ROM | disk | FTP | other *** search
- /***************************************************************************
- *
- * Density module for Screen_Printer
- */
-
- #include <exec/types.h>
- #include <devices/printer.h>
- #include <devices/prtbase.h>
-
- void SetDensity(ULONG density_code)
- {
- extern struct PrinterData *PD;
- extern struct PrinterExtendedData *PED;
-
- /* SPECIAL_DENSITY 0 1 2 3 4 5 6 7 */
- static int XDPI[8] = {80, 80, 80, 120, 160, 180, 240, 300};
- static int YDPI[8] = {68, 68, 80, 120, 136, 180, 240, 300};
-
- /* Set page size to defaults */
- PED->ped_MaxColumns = 80; /* 8.0" */
- PED->ped_MaxYDots = 100; /* 10.0" */
- switch(PD->pd_Preferences.PaperSize) {
- case W_TRACTOR:
- PED->ped_MaxColumns = 136; /* 13.6" x 10.0" */
- break;
- case US_LEGAL:
- PED->ped_MaxYDots = 140; /* 8.0" x 14.0" */
- break;
- case CUSTOM:
- PED->ped_MaxColumns =
- PD->pd_Preferences.PrintMaxWidth;
- PED->ped_MaxYDots =
- PD->pd_Preferences.PrintMaxHeight;
- break;
- }
- density_code /= SPECIAL_DENSITY1;
- PED->ped_MaxXDots =
- XDPI[density_code] * PED->ped_MaxColumns / 10;
- PED->ped_MaxYDots = YDPI[density_code] * PED->ped_MaxYDots / 10;
- PED->ped_XDotsInch = XDPI[density_code];
- PED->ped_YDotsInch = YDPI[density_code];
- }
-