Skip to content

Conversation

@viklequick
Copy link

@viklequick viklequick commented Dec 28, 2025

Added printer support in far editor through wxWidgets printing (via HTML/RTF) for UI, and simple lp-based for console. Printer caps are exposed by corresponding backend.

image

Using editor colors, the code computes "close" colors of the text to the white paper using RGB-LAB color space conversion. The character colors are being used from the editor directly, so if colorer didn't finished the colorization printer support will not see it too.

@viklequick viklequick changed the title [WIP] Added printer support in far editor Printer support in far editor Dec 28, 2025
@viklequick
Copy link
Author

Actually, it is looks likee this way:

image

(standard preview for wxWidgets)

@viklequick
Copy link
Author

viklequick commented Dec 28, 2025

The same for macos, selected fragment

image

@viklequick
Copy link
Author

UTF-8 works as expected:

image

@viklequick
Copy link
Author

Macos native support

image

@viklequick
Copy link
Author

viklequick commented Jan 26, 2026

Basically, the code works as follows (wxWidgets backend active):

  1. Examine selected fragment (or whole file) against colors that are being used for painting.
  2. Using RGB -> LAB -> RGB conversion, colors are adjusted to be visible on white background (paper).
  3. The result is converted to specific HTML (compatible with wxHtmlPrinting component)
  4. Using wx UI, the file is displayed as preview, with ability to print it on printer directly.
  5. For macos, the native components are being used instead of wx, but the HTML file is the same.

For terminal backend, as there is no UI available, the file is placed "as is", as text file, and then send to printer using lp command. If the printer configured, the file (or selected fragment) is being sent to the default printer (if configured). I've checked this against real hardware printer.

The HTML generation was not moved out to the backend on purpose: the same HTML can be used to support clipboard (with additional flavor) directly in editor.

@viklequick
Copy link
Author

Looks like it is ready to merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants