FLTK logo

[master] ba7b242 - Make Fl_GTK_Printer_Driver recognize more paper sizes

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] ba7b242 - Make Fl_GTK_Printer_Driver recognize more paper sizes "ManoloFLTK" 08:32 Apr 08  
 
commit ba7b2427b6dabbc1200207fff3b576d09f18c931
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Mon Apr 8 17:24:38 2024 +0200
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Mon Apr 8 17:24:38 2024 +0200

    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 src/Fl_Paged_Device.cxx src/Fl_Paged_Device.cxx
index aed1080..850a5e0 100644
--- src/Fl_Paged_Device.cxx
+++ 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 src/drivers/Posix/Fl_Posix_Printer_Driver.cxx src/drivers/Posix/Fl_Posix_Printer_Driver.cxx
index bc3b991..eff6ab5 100644
--- src/drivers/Posix/Fl_Posix_Printer_Driver.cxx
+++ 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
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.