Paper Sizes

This commit is contained in:
Jasmine Iwanek
2025-08-03 22:06:33 -04:00
parent 60d8ea389f
commit b2067d7946
3 changed files with 58 additions and 4 deletions

View File

@@ -0,0 +1,50 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* Define the various paper sizes for printers.
*
* Authors: Jasmine Iwanek, <jasmine@iwanek.co.uk>
*
* Copyright 2025 Jasmine Iwanek
*/
#ifndef EMU_PRT_PAPERSIZES_H
#define EMU_PRT_PAPERSIZES_H
/* Standard U.S. Letter */
#define LETTER_PAGE_WIDTH 8.5
#define LETTER_PAGE_HEIGHT 11.0
/* Standard U.S. Legal */
#define LEGAL_PAGE_WIDTH 8.5
#define LEGAL_PAGE_HEIGHT 14.0
/* Standard U.S. Ledger */
#define LEDGER_PAGE_WIDTH 11.0
#define LEDGER_PAGE_HEIGHT 17.0
/* Standard A0 */
#define A0_PAGE_WIDTH 33.125
#define A0_PAGE_HEIGHT 46.75
/* Standard A1 */
#define A1_PAGE_WIDTH 23.375
#define A1_PAGE_HEIGHT 33.125
/* Standard A2 */
#define A2_PAGE_WIDTH 16.5
#define A2_PAGE_HEIGHT 23.375
/* Standard A3 */
#define A3_PAGE_WIDTH 11.75
#define A3_PAGE_HEIGHT 16.5
/* Standard A4 */
#define A4_PAGE_WIDTH 8.25
#define A4_PAGE_HEIGHT 11.75
#endif /*EMU_PLAT_FALLTHROUGH_H*/

View File

@@ -72,15 +72,18 @@
#include <86box/png_struct.h>
#include <86box/printer.h>
#include <86box/prt_devs.h>
#include <86box/prt_papersizes.h>
/* Default page values (for now.) */
#define COLOR_BLACK 7 << 5
#define PAGE_WIDTH 8.5 /* standard U.S. Letter */
#define PAGE_HEIGHT 11.0
#define PAGE_WIDTH LETTER_PAGE_WIDTH
#define PAGE_HEIGHT LETTER_PAGE_HEIGHT
#if 0
#define PAGE_LMARGIN 0.0
#define PAGE_RMARGIN PAGE_WIDTH
#define PAGE_TMARGIN 0.0
#define PAGE_BMARGIN PAGE_HEIGHT
#endif
#define PAGE_DPI 360
#define PAGE_CPI 10.0 /* standard 10 cpi */
#define PAGE_LPI 6.0 /* standard 6 lpi */

View File

@@ -64,12 +64,13 @@
#include <86box/printer.h>
#include <86box/prt_devs.h>
#include "cpu.h"
#include <86box/prt_papersizes.h>
#define FULL_PAGE 1 /* set if no top/bot margins */
/* Default page values (for now.) */
#define PAGE_WIDTH 8.5 /* standard U.S. Letter */
#define PAGE_HEIGHT 11
#define PAGE_WIDTH LETTER_PAGE_WIDTH
#define PAGE_HEIGHT LETTER_PAGE_HEIGHT
#define PAGE_LMARGIN 0.25 /* 0.25" left and right */
#define PAGE_RMARGIN 0.25
#if FULL_PAGE