From ba7b2427b6dabbc1200207fff3b576d09f18c931 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Mon, 8 Apr 2024 17:24:38 +0200 Subject: [PATCH] Make Fl_GTK_Printer_Driver recognize more paper sizes also, make clear the B* paper size names are from JIS not ISO. --- src/Fl_Paged_Device.cxx | 22 +++++++++---------- src/drivers/Posix/Fl_Posix_Printer_Driver.cxx | 6 +++++ 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/Fl_Paged_Device.cxx b/src/Fl_Paged_Device.cxx index aed108022..850a5e055 100644 --- a/src/Fl_Paged_Device.cxx +++ b/src/Fl_Paged_Device.cxx @@ -126,17 +126,17 @@ const Fl_Paged_Device::page_format Fl_Paged_Device::page_formats[NO_PAGE_FORMATS { 105, 148, "A9"}, // B* // index(Bi) = i+10 - {2920, 4127, "B0"}, - {2064, 2920, "B1"}, - {1460, 2064, "B2"}, - {1032, 1460, "B3"}, - { 729, 1032, "B4"}, - { 516, 729, "B5"}, - { 363, 516, "B6"}, - { 258, 363, "B7"}, - { 181, 258, "B8"}, - { 127, 181, "B9"}, - { 91, 127, "B10"}, + {2920, 4127, "B0(JIS)"}, + {2064, 2920, "B1(JIS)"}, + {1460, 2064, "B2(JIS)"}, + {1032, 1460, "B3(JIS)"}, + { 729, 1032, "B4(JIS)"}, + { 516, 729, "B5(JIS)"}, + { 363, 516, "B6(JIS)"}, + { 258, 363, "B7(JIS)"}, + { 181, 258, "B8(JIS)"}, + { 127, 181, "B9(JIS)"}, + { 91, 127, "B10(JIS)"}, // others { 459, 649, "EnvC5"}, // envelope diff --git a/src/drivers/Posix/Fl_Posix_Printer_Driver.cxx b/src/drivers/Posix/Fl_Posix_Printer_Driver.cxx index bc3b99176..eff6ab5ec 100644 --- a/src/drivers/Posix/Fl_Posix_Printer_Driver.cxx +++ b/src/drivers/Posix/Fl_Posix_Printer_Driver.cxx @@ -40,6 +40,9 @@ class Fl_Posix_Printer_Driver : public Fl_PostScript_File_Device { #define GTK_PAPER_NAME_LEGAL "na_legal" #define GTK_PAPER_NAME_A3 "iso_a3" #define GTK_PAPER_NAME_A5 "iso_a5" +#define GTK_PAPER_NAME_JB5 "jis_b5" +#define GTK_PAPER_NAME_TABLOID "na_ledger" +#define GTK_PAPER_NAME_DLE "iso_dl" #define GTK_RESPONSE_NONE 0 #define GTK_RESPONSE_OK -5 #define GTK_PRINT_PAGES_RANGES 2 @@ -156,6 +159,9 @@ int Fl_GTK_Printer_Driver::begin_job(int pagecount, int *firstpage, int *lastpag else if (strcmp(pname, GTK_PAPER_NAME_LEGAL) == 0) format = Fl_Paged_Device::LEGAL; else if (strcmp(pname, GTK_PAPER_NAME_A3) == 0) format = Fl_Paged_Device::A3; else if (strcmp(pname, GTK_PAPER_NAME_A5) == 0) format = Fl_Paged_Device::A5; + else if (strcmp(pname, GTK_PAPER_NAME_JB5) == 0) format = Fl_Paged_Device::B5; + else if (strcmp(pname, GTK_PAPER_NAME_TABLOID) == 0) format = Fl_Paged_Device::TABLOID; + else if (strcmp(pname, GTK_PAPER_NAME_DLE) == 0) format = Fl_Paged_Device::DLE; GtkPrinter *gprinter = CALL_GTK(gtk_print_unix_dialog_get_selected_printer)(pdialog); //2.10 psettings = CALL_GTK(gtk_print_unix_dialog_get_settings)(pdialog); //2.10 const char* p = CALL_GTK(gtk_print_settings_get)(psettings, "output-uri"); //2.10