[Patch] Epson LX-810 Dot-matrix printer WIP code
Posted: Sat 23 Jan, 2021 12:52 am
So, COVID has taken away some of the joy of working on hobby projects at home. Until (hopefully) some of that comes back, I decided to rebase the code I already had to v17 and dump it here if someone wants to have fun.
See here for more information: https://pcem-emulator.co.uk/phpBB3/view ... f=3&t=3386
This was only tested on Linux (the windows direct-to-printer code wasn't tested), has a new dependency (Freetype), is somewhat awkward to set-up, is very invasive to PCem (did some quick hacks to to parallel port interface and the UI menus), the menus have no feedback (because we don't have the printer's lights and beeps), and, finally: it works nicely!
Instructions extracted from the patch:
Most of this code was taken from an old (as of 2020) unfinished DOSBox patch.
I've fixed numerous issues with the interface, drawing and printer logic and
this should print most things correctly and with the right positioning.
Tested under DOS (Print Screen key, Edit.exe, Word Perfect 5.1), Win 3.1
(Write, Paintbrush) and Win 95 (Word 6, Paint). I've adapted it (ESC/P
commands resolution, mainly) to emulate the Epson LX-810, which is the
printer that I have.
Dependencies: Freetype (until I have a dump of the character ROM - or maybe
I keep it for an inaccurate "high-res" output?)
Output: Postscript, BMP, PNG, TIFF, JPG.
(Haven't tested the Windows printer forwarding yet.)
These are the print modes for the Epson LX-810:
-Bitmap printing emulates the pins but can optionally keep the old behaviour
from the DOSBox patch and output continuously. Pin emulation is naive for
now.
-Draft printing uses freely redistributable fonts that imitate the Epson FX
Printers, they look almost the same as the LX-810. Not all extended
characters are available and sometimes a combination of styles and effects
isn't available, so it will fallback to a similar one (in this case the dots
can potentially have slightly different dimensions.) High-speed draft
characters are not available. Should be OK for english ASCII printing.
-Provide your own monospaced Roman and Sans Serif truetype or opentype fonts.
Most fonts are pretty complete unicode-wise, so these will look nice.
There is also code to handle non-monospaced fonts automatically that should
work OK.
INSTRUCTIONS:
Currently, a "printer" directory on the pcem main path is used. On Linux this
would be "~/.pcem/printer" by default. There, the fonts roman.ttf,
roman_italics.ttf, sansserif.ttf and sansserif_italics.ttf should be present.
Also a subdirectory "fonts" with all the Epson FX-80 opentype fonts from
http://const-iterator.de/fxmatrix/ should exist. This same directory will be
used for all the output files.
There is also a menu for pressing some of the printer's control panel
buttons. On Linux, access with a right-click while the mouse is ungrabbed.
TODO/Notes:
-Dump/Recreate the character ROM. This should make it possible to use the
bitgraph functions to print the characters too.
-Better TTF font handling. Use STB TTF?
-Bind the printer panel buttons to key combinations in addition to the menu?
-Menu commands should only work when the printer is not accepting data. (Use
DC1 / DC3 for this? Or the select bit in the parallel port?)
-Make the Windows print redirection better (currently is a hack that shows
the printing dialog too soon).
-Dump to PDF with GhostScript.
-Printer redirection on linux (GhostScript, CUPS)
-Update the Mingw Makefiles with FreeType.
-Search for TODO in this file.
See here for more information: https://pcem-emulator.co.uk/phpBB3/view ... f=3&t=3386
This was only tested on Linux (the windows direct-to-printer code wasn't tested), has a new dependency (Freetype), is somewhat awkward to set-up, is very invasive to PCem (did some quick hacks to to parallel port interface and the UI menus), the menus have no feedback (because we don't have the printer's lights and beeps), and, finally: it works nicely!
Instructions extracted from the patch:
Most of this code was taken from an old (as of 2020) unfinished DOSBox patch.
I've fixed numerous issues with the interface, drawing and printer logic and
this should print most things correctly and with the right positioning.
Tested under DOS (Print Screen key, Edit.exe, Word Perfect 5.1), Win 3.1
(Write, Paintbrush) and Win 95 (Word 6, Paint). I've adapted it (ESC/P
commands resolution, mainly) to emulate the Epson LX-810, which is the
printer that I have.
Dependencies: Freetype (until I have a dump of the character ROM - or maybe
I keep it for an inaccurate "high-res" output?)
Output: Postscript, BMP, PNG, TIFF, JPG.
(Haven't tested the Windows printer forwarding yet.)
These are the print modes for the Epson LX-810:
-Bitmap printing emulates the pins but can optionally keep the old behaviour
from the DOSBox patch and output continuously. Pin emulation is naive for
now.
-Draft printing uses freely redistributable fonts that imitate the Epson FX
Printers, they look almost the same as the LX-810. Not all extended
characters are available and sometimes a combination of styles and effects
isn't available, so it will fallback to a similar one (in this case the dots
can potentially have slightly different dimensions.) High-speed draft
characters are not available. Should be OK for english ASCII printing.
-Provide your own monospaced Roman and Sans Serif truetype or opentype fonts.
Most fonts are pretty complete unicode-wise, so these will look nice.
There is also code to handle non-monospaced fonts automatically that should
work OK.
INSTRUCTIONS:
Currently, a "printer" directory on the pcem main path is used. On Linux this
would be "~/.pcem/printer" by default. There, the fonts roman.ttf,
roman_italics.ttf, sansserif.ttf and sansserif_italics.ttf should be present.
Also a subdirectory "fonts" with all the Epson FX-80 opentype fonts from
http://const-iterator.de/fxmatrix/ should exist. This same directory will be
used for all the output files.
There is also a menu for pressing some of the printer's control panel
buttons. On Linux, access with a right-click while the mouse is ungrabbed.
TODO/Notes:
-Dump/Recreate the character ROM. This should make it possible to use the
bitgraph functions to print the characters too.
-Better TTF font handling. Use STB TTF?
-Bind the printer panel buttons to key combinations in addition to the menu?
-Menu commands should only work when the printer is not accepting data. (Use
DC1 / DC3 for this? Or the select bit in the parallel port?)
-Make the Windows print redirection better (currently is a hack that shows
the printing dialog too soon).
-Dump to PDF with GhostScript.
-Printer redirection on linux (GhostScript, CUPS)
-Update the Mingw Makefiles with FreeType.
-Search for TODO in this file.