TextPaint
Paint using semigraphic characters
Install / Use
/learn @andrzejlisek/TextPaintREADME
Overview
TextPaint is not designed to use as plain text editor, there is designed to create or modify text as a simple graphic or scheme using ANSI or Unicode characters. You can create texts such as organizational charts, simple circuit schemes, algorithm flow, tables, to use it where destination medium supports text printed using fixed-width font.
The text can be both monochrome saved as plain text or color saved as text with ANSI escape commands. You can view or edit many existing ASCII-art or ANSI-art files.
This application works in system console, but it can also work as graphical window, which simulates the console. You can resize the console or window, but application will be repainted after pressing any key. Application will not be repainted after resizing while the character selector is shown, but the application will be repainted after closing the character table and pressing any key.
TextPaint also provides simple cipher, which user Vigenere algorithm. You can encipher some text fragments using password.
Other functions
TextPaint has other function than text editor, called as work modes. Other work modes uses the same ANSI interpreter and was implemented to test various cases.
There are available following work modes, choosen by WorkMode parameter:
- WorkMode=0 - Text editor, the main purpose of TestPaint, which is described in Readme.md file.
- WorkMode=1 - ANSI viewer with progressive printing and server. This mode can be used to view animation created by progressive placing characters and is described in Readme_ANSI.md file.
- WorkMode=2 - Telnet or SSH client, which is parially compatible with VT100, ANSI and derivative terminal emulators. Details about this mode are described in Readme_ANSI.md file.
- WorkMode=3 - Encoding list display and keycode test. The only purpose is displaying supported encoding list and code/name of every pressed key, which is needed to implement additional functions and test the TextPaint in various platforms. This mode is described in Readme_keys.md file.
- WorkMode=4 - Non-interactive simple command line application, without any interface:
- Render text into bitmap image detailed in Readme_render.md file.
- Convert XBIN or BIN file to ANSI text file.
- Save to files all available 1-byte encodings.
Two editions
TextPaint exists in two editions:
- .NET Framework - compatible with .NET 4.5, uses Windows Forms as graphical user interface.
- .NET Core - compatible with .NET 6.0, uses Avalonia as graphical user interface.
Both editions have identical functionality, but can have some subtle differences like following:
- Available .NET built-in text encodings.
- Bell sound availability.
- Interaction with system clipboard.
- Fullscreen window display.
Application running
For the .NET Framework edition, input file name as command line parameter. If you not give parameter or give blank file name, the Config.txt file will be opened to allow editing the configuration file.
TextPaint.exe FileNameWithPath.txt [parameters]
If you use Mono project (required in Linux), you can run application with this command:
mono TextPaint.exe FileNameWithPath.txt [parameters]
The .NET Core edition can be run on Windows and Linux by the command:
dotnet TextPaint.dll FileNameWithPath.txt [parameters]
In the further document text, there will be uset the TextPaint as application file name.
You can also override configuration options, which can be used in Config.txt file. From second parameter, application accepts configuration parameters profided with = character. For example, to force running in 40x15 window, run this command:
TextPaint FileNameWithPath.txt WinUse=2 WinW=40 WinH=15
In work mode 3, in place of file name, you have to provide server address with port. if the port equals to 23, it can be ommited.
TextPaint 192.168.1.100:23 WorkMode=3
All options are described in Configuration file chapter.
Application files and directories
TextPaint is supplied with the following files and directories:
- Samples - Sample text files.
- Fonts - Bitmap fonts.
- Config.txt - Main configuration file.
- Fav.txt - Favorite character definitions.
- Info.txt - Context information.
- TextPaint.exe or TextPaint.dll - Application binary executable.
- Libraries needed to run the TextPaint.
Functionality and interface

TextPaint can work in one of the 4 states. The default state is state 1. In all states, you can use these keys:
- Arrows - Move cursor horizontally or vertically.
- Home, End, PageUp, PageDown - Move cursor diagonally.
- Tab - Change cursor visualization type, one of four modes. This function may help to match writing/drawing to other objects.
- F1 - Switch to state 1 (edit text) or show information about state 1.
- F2 - Switch to state 2 (edit characters) or show information about state 2.
- F3 - Switch to state 3 (character paint) or show information about state 3.
- F4 - Switch to state 4 (pixel paint) or show information about state 4.
- F7 - Save file. If the cipher is enabled, you will have to input cipher password twice. If password is not the same, you will have to input password one more time.
- F8 - Reload file. If the cipher is enabled, you will have to input cipher password used to save the file.
- F9 - Open character selection to draw.
- F12 - Quit TextPaint.
- Z - Undo (not works in state 1 and state 2).
- X - Redo (not works in state 1 and state 2).
To undo or redo editing text or characters (state 1 or state 2), you can undo/redy by following procedure:
- Switch temporarily to state 2 or state 3.
- Press Z or X key to undo or redo.
- Switch back to state 0 or state 1.
The other available keys depends on the current working state. The unnecessary spaces and lines are automatically trimmed during editing. You can write on the grey aread, then necessary lines or spaces will be added automatically.
The colors are following:
- White text on black background - Actual text.
- Dark gray - Space beyond end of line.
- Bright gray - Space below the last line.
- Black text in white background - Status bar.
Load another file during session
You can load another file without close and restart the TextPaint application. If you write the full path for another file and press the F8, the another file will be loaded if the file exists and can be loaded. Otherwise, the same file will be reloaded.
This feature allows to load other file by dropping the file icon onto the TextPaint console/window. Before load other file, make sure, that:
- TextPaint is in the State 1.
- One of the following conditions:
- The text writing direction is the right (the Text-R on the status bar) and cursor is in the most left column.
- The text writing direction is the down (the Text-D on the status bar) and cursor is in the most top line.
Theoretically, there is possible loading the file in every text direction, but the Text-R and Text-D are the most recommended.
If you drop the file icon, the operating system will automatically write the full path for the file. If you press the F8 key, the text before the cursor (the opposite direction than the write direction) will be analyzed. If the text represents the correct path, the other file fill be loaded. In the console (when WinUse=0), the path will be cange in operating system specified method. TextPaint can recognize the change in the path and automatically change the path back. The operating system changess the path are as following and there is not possible to affect the console behavior:
- Windows: Use the double quotes arounding the path.
- Linux: Use single quotes arounding the path or preceed the path with dollar character.
- MacOS: Precede every special character with backslach.
Context information
When you press the F1, F2, F3, F4 key one more time, after switchint to the state, there will be displayed short information about selected state. Use arrow keys to scroll the text.

To close information, press Esc or any F key (F1-F12). The informations are read from the Info.txt file.
Status bar
At the bottom of console window, there is the status bar, with black text on white background. The status bar in state 1, state 2 and state 3 has the following informations from left to right:
- Font and cursor size (width and height).
- Cursor position (row and column). The character between numbers indicated current text area:
- Colon - All cells of the cursor are inside some text line.
- Semicolon - At least one cursor cell is beyond end of text line, but all cursor cells are not below the last line.
- Comma - At least one cell of the cursor is below the last line of text.
- Character number and glyph under the most cursor cells.
- Number of background and foreground color under the most cursor cells, the hyphen indicates, that color is not defined (used default).
- Attribute state as 7-character string under the most cursor cells, where underscore means disabled attribute and letter means enabled attribute as following:
- B - Bold
- I - Italic
- U - Underscore
- S - Strikethrough
- K - Blink
- R - Reserved
- C - Concealed
- State indicator:
- Text - Write text (state 1), followed by direction indicator:
- R - Right - From left to right.
- Text - Write text (state 1), followed by direction indicator:
