Import Dave Coffin's HBPL1v1 code (and a few extras)#21
Conversation
Merge hbpl1 parts of Dave Coffin's hbpl1.patch (located here): https://web.archive.org/web/20160515134331/http://cybercom.net/~dcoffin/hbpl/hbpl1.patch to current 2026jul5 foo2zjs NOTE: Edits required on several files to sync-up to current code base.
Doing comparisons between 2014 files versus 2026 files similar to hbpl1/hbpl2 added similar edits to hbpl1 files to get them closer for general use. NOTE: More edits are still required on several files.
Seeing my printer not supported for the last decade, and then seeing this: "Works with Xerox Phaser 6010N OpenPrinting#6" mikerr/foo2zjs#6 Got me interested in looking at adding HBPLv1. Cloned Dell C1760, and then fetched data points from old PPD files.
e.g. -p1 which are then being picked up as an invalid paper size In cups error_log manifesting as: foo2hbpl1-wrapper: Unimplemented paper code 1 Have amended foo2hbpl1-wrapper.in to intepret paper sizes paper parameters are also now being interpreted. This has fixed for a Dell 1660w printer, running on Ubuntu 18.04 Import Shinbar's fix for paper_size cups error_log as seen here: https://github.com/Shinbar/foo2zjs/commits/shinbar/dev2020/papersize/ Initially found here: OpenPrinting#2
Import Shinbar's fix for paper_size cups error_log as seen here: https://github.com/Shinbar/foo2zjs/commits/shinbar/dev2020/papersize/ Initially found here: OpenPrinting#2
Import Shinbar's fix for paper_size cups error_log as seen here: https://github.com/Shinbar/foo2zjs/commits/shinbar/dev2020/papersize/ Initially found here: OpenPrinting#2
Helps a little with debugging.
All the info in *mname[] is static and therefore also threadsafe, but it will be useful to access for debugging "-D[1+]" in future.
Looking at the original HBPL1 codes from 2014 and a more recent version it looks like we need to add an expanded class of media codes with two codes that changed wording (COAT2, RECYCLED). To resolve the two code sets, added a -z1 option. Both mname[MediaCode+1] sets appear to work on the Xerox 6010N, but don't see if there is an actual difference for codes 1..24. mname[MediaCodes+1] appear okay on Ubuntu 26.04 FireFox for the 6010N. Many files still need upgrading. Testing was done using: gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE -sPAPERSIZE=letter \ -r600x600 -sDEVICE=pamcmyk32 -sOutputFile=- - \ <testpage.ps >testpage.za ./foo2hbpl1 -m1 -p0 <testpage.za >testpage.zm ./hbpldecode testpage.zm cat testpage.zm > /dev/tcp/printer_IP_address/9100
Easier to see '-' vs 'na' (used by foo2hiperc*.1 vs foo2zjs*.1)
Don't know if -z0 printers can handle or understand RESET so this was limited to -z1 or higher versions ./foo2hbpl1
Copies works, but don't know about older -z0 printers, therefore left them as-is using a manual copy method.
Exit if EOF or other errors<0, and return -1
Helps to see values generated during processing.
All the info in papers[] is static and therefore also threadsafe, but it can also be useful to access for debugging with "-D[1+]".
Add papers to foo2hbpl1.c, foo2hbpl1.1, foo2hbpl1-wrapper.1 Fixes to foo2hbpl1-wrapper paper, mediacodes and clipping. Ubuntu 26.04 recognizes 6010N plugged-into USB and FireFox prints, but Copies -n not propogated through ATM. Adjusted minimum foo2hbpl1.c margins from 8 to 33 (printer choked on 11).
Edit border minimums to allow headers and footers to fit without getting chopped off by clipping for 6000B and 6010N. Did not try to adjust -z0 printer borders as they might be some different value. Add missing black-text.ps needed for monochome printouts. Reset Copies for manual creation since the blocker might be cups or something else, otherwise Copies works ok with -z1 and 6010N. Suspect Fuji CP105, and maybe 215, are similar to 6000B or 6010N because internet references suggest using 6000B or 6010N drivers to substitute for them, however I left these as -z0 PPD files so that they should still work okay. Upgrading these is better left for someone else to try that has one of these types of printers.
Also sync naming further, like Letter instead of letter.
6ef5446 to
3805c5d
Compare
|
apparently Savetoner code is for 1bit per pixel (looking at the &0x55/&0xAA), needs correcting for 8bits per pixel. looking closer at foomatic-db, some of these printers could probably be migrated there too. |
Allow for unit testing using tools like "md5sum testpage.prn" If Debug >= 9, then output a static date/time
...and replace some for loops with faster memset(). ...and do some formatting. Oddly -D2 not printing if -S1, but ok with -S2/3/4.
The printers listed are personal laser printers with no fancy features seen. If there is one with these features, we can always add the extra features as probably a -z2 class printer. Changed -u to be consistent with other wrappers and programs which use -u leftxtop and -l rightxbottom instead of "-u left,top,right,bottom". Since this behaviour is no longer the same as 1.4 then program and the wrapper both need to be updated to 2.0 for the next tag/release point. Also added -A AllIsBlack(), -B BlackClears() used only in CMYK mode. BlackClears() is run first so that there are fewer AllIsBlack() to do. To save on toner, these are turned-on by default in foo2hbpl1-wrapper, so these two options are available to enable but ignored as always on.
Works as foo2hbpl1-wrapper, but did not see anything to toggle this in ubuntu 26.04 firefox print options.
Allow foo2hbpl1 to spool several jobs at the same time.
|
Looked at building make test, but I'm currently running gs 10.05.1 |
|
At this point, printer is discovered and runs okay in Ubuntu 26.04 x86_64, |
|
Looked at libppd and noted: ...therefore stopping here. |
At this point, there is still more to fix and add, but it is a start with issue #2 .
I'm looking at MediaCodes, and comparing the David's 2014 code
it appears we are looking at 2 classes of printers, where the 2nd class printer has...
It may mean needing to create something similar to -z0 -z1 used with foo2zjs
@ValdikSS - Question to ask: