Name | pyscape JSON |
Version |
1.0.1
JSON |
| download |
home_page | https://github.com/ysard/escapy |
Summary | An advanced Python interpreter for ESC/P and ESC/P2 commands, efficiently and accurately converting your print workflows into precise vectorial PDFs. |
upload_time | 2025-02-02 20:31:45 |
maintainer | None |
docs_url | None |
author | Ysard |
requires_python | >=3.10 |
license | None |
keywords |
printer
dotmatrix
escp2
escp
pdf
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
[](https://github.com/ysard/escapy/releases/latest/)
[](https://pypi.python.org/pypi/pyscape)
[](https://pypi.python.org/pypi/pyscape)
[](https://github.com/ysard/escapy/actions)
[](https://interrogate.readthedocs.io/en/latest/)
[](https://docs.pytest.org/en/latest/)
[](https://github.com/ysard/escapy/blob/main/LICENCE)
[](https://liberapay.com/Ysard/donate)
<!--[](https://escapy.readthedocs.io/en/latest/)-->
<a name="readme-top"></a>
<div align="center">
# EscaPy
EscaPy is a **thoroughly tested** tool that **reliably** and almost
**exhaustively** interprets the ESC/P and ESC/P2 command sets defined by Epson
([Wikipedia - Epson ESC/P](https://en.wikipedia.org/wiki/ESC/P)), then converts
the data formerly intended for printers into a modern PDF file.
</div>
## Table of Contents
<details>
<summary>Open Contents</summary>
- [EscaPy](#title)
- [:information_source: About the Project](#information_source-about-the-project)
- [:book: Foreword](#book-foreword)
- [:bank: Donations](#bank-donations)
- [:star: Features](#star-features)
- [⚙ Setup](#-setup)
- [Installation](#installation)
- [Usage](#usage)
- [Examples](#examples)
- [:newspaper: Configuration file](#newspaper-configuration-file)
- [:abc: Fonts](#abc-fonts)
- [:a: User-defined characters](#a-user-defined-characters)
- [:u7a7a: Unsupported encodings (Chinese, Japanese, etc.)](#u7a7a-unsupported-encodings-chinese-japanese-etc)
- [:trophy: Acknowledgements](#trophy-acknowledgements)
- [Absence of acknowledgements](#absence-of-acknowledgements)
- [👏🏻 Contributions](#-contributions)
- [:book: License](#book-license)
</details>
## :information_source: About the Project
**TL;DR**: Your DOS system or emulator will be able to produce searchable
PDF files.
This tool is compatible with files produced by the
[Libre Printer](https://github.com/ysard/libre-printer) interface discussed below.
## :book: Foreword
Nowadays, older equipment may still be in use in sectors such as medical or
industrial (machine tools). While the software of the old days were often
designed to use dot-matrix printers exclusively, these printers can break down
or can no longer be used due to a lack of consumables available on the market.
As a result, the entire system has to be replaced without justification.
EscaPy generates PDF files from the raw data sent to the printer.
Files can therefore be stored permanently, printed on new hardware, indexed by
an archiving system (text remains accessible) or simply consulted at any time.
Note that data destined for the printer must be captured in some way.
The [Libre Printer](https://github.com/ysard/libre-printer) project accomplishes
exactly this task by providing a software and hardware interface pretending
to be a printer compatible with older hardware.
## :bank: Donations
EscaPy is a project that took ~2 months of full-time work and 12k+ lines
including documentation & tests, for its first version.
If it has been useful to you in any way and you would like to contribute to its
development, please follow the link below, with all thanks :
[](https://liberapay.com/Ysard/donate)

1EB6dc6YULzHR4TMqLi5fomZ6wmdP3N5cW
## :star: Features
- [x] **Advanced ESC/P ESC/P2 command set support**
Nearly all commands are supported (text, graphics and barcodes).
<details>
<summary><b>See details</b></summary>
*: Not recommended command.<br>
:white_check_mark:: Implemented.<br>
:heavy_exclamation_mark:: Not fully implemented.<br>
:white_large_square:: Not implemented.<br>
:no_entry_sign:: Will not be implemented.<br>
| Setting the page format | | |
|----------------------------------|---------------------------------------------|----------------------|
| ESC ( C | Set page length in defined unit | :white_check_mark: |
| ESC ( c | Set page format | :white_check_mark: |
| ESC C | Set page length in lines | :white_check_mark: |
| ESC C NUL | Set page length in inches | :white_check_mark: |
| ESC N | Set bottom margin | :white_check_mark: |
| ESC O | Cancel bottom margin | :white_check_mark: |
| ESC Q | Set right margin | :white_check_mark: |
| ESC l | Set left margin | :white_check_mark: |
| | | |
| Moving the print position | | |
| CR | Carriage return | :white_check_mark: |
| LF | Line feed | :white_check_mark: |
| FF | Form feed | :white_check_mark: |
| ESC $ | Set absolute horizontal print position | :white_check_mark: |
| ESC \ | Set relative horizontal print position | :white_check_mark: |
| ESC ( V | Set absolute vertical print position | :white_check_mark: |
| ESC ( v | Set relative vertical print position | :white_check_mark: |
| ESC J | Advance print position vertically | :white_check_mark: |
| HT | Tab horizontally | :white_check_mark: |
| VT | Tab vertically | :white_check_mark: |
| ESC f | Horizontal/vertical skip* | :white_check_mark: |
| BS | Backspace* | :white_check_mark: |
| | | |
| Setting the units | | |
| ESC ( U | Set unit | :white_check_mark: |
| ESC 0 | Select 1/8-inch line spacing | :white_check_mark: |
| ESC 2 | Select 1/6-inch line spacing | :white_check_mark: |
| ESC 3 | Set n/180-inch line spacing | :white_check_mark: |
| ESC 3 | Set n/216-inch line spacing | :white_check_mark: |
| ESC + | Set n/360-inch line spacing | :white_check_mark: |
| ESC A | Set n/60-inch line spacing* | :white_check_mark: |
| ESC A | Set n/72-inch line spacing* | :white_check_mark: |
| ESC 1 | Select 7/72-inch line spacing* | :white_check_mark: |
| ESC D | Set horizontal tabs | :white_check_mark: |
| ESC B | Set vertical tabs | :white_check_mark: |
| ESC b | Set vertical tabs in VFU channels* | :white_large_square: |
| ESC / | Select vertical tab channel* | :white_large_square: |
| ESC e | Set fixed tab increment* | :white_large_square: |
| ESC a | Select justification* | :white_large_square: |
| | | |
| Selecting characters | | |
| ESC ( t | Assign character table | :white_check_mark: |
| ESC t | Select character table | :white_check_mark: |
| ESC R | Select an international character set | :white_check_mark: |
| ESC & | Define user-defined characters | :heavy_exclamation_mark: |
| ESC : | Copy ROM to RAM | :white_check_mark: |
| ESC % | Select user-defined set | :white_check_mark: |
| ESC x | Select LQ or draft | :white_check_mark: |
| ESC x | Select NLQ or draft | :white_check_mark: |
| ESC k | Select typeface | :white_check_mark: |
| ESC X | Select font by pitch and point | :white_check_mark: |
| ESC c | Set horizontal motion index (HMI) | :white_check_mark: |
| ESC P | Select 10.5-point, 10-cpi | :white_check_mark: |
| ESC P | Select 10-cpi | :white_check_mark: |
| ESC M | Select 10.5-point, 12-cpi | :white_check_mark: |
| ESC M | Select 12-cpi | :white_check_mark: |
| ESC g | Select 10.5-point, 15-cpi | :white_check_mark: |
| ESC g | Select 15-cpi | :white_check_mark: |
| ESC p | Turn proportional mode on/off | :white_check_mark: |
| ESC SP | Set intercharacter space | :white_check_mark: |
| ESC E | Select bold font | :white_check_mark: |
| ESC F | Cancel bold font | :white_check_mark: |
| ESC 4 | Select italic font | :white_check_mark: |
| ESC 5 | Cancel italic font | :white_check_mark: |
| ESC ! | Master select | :white_check_mark: |
| ESC G | Select double-strike printing | :white_check_mark: |
| ESC H | Cancel double-strike printing | :white_check_mark: |
| ESC - | Turn underline on/off | :white_check_mark: |
| ESC ( - | Select line/score | :white_check_mark: |
| ESC S | Select superscript/subscript printing | :white_check_mark: |
| ESC T | Cancel superscript/subscript printing | :white_check_mark: |
| ESC q | Select character style | :white_check_mark: |
| SI | Select condensed printing | :white_check_mark: |
| ESC SI | Select condensed printing* | :white_check_mark: |
| DC2 | Cancel condensed printing | :white_check_mark: |
| SO | Select double-width printing (one line) | :white_check_mark: |
| ESC SO | Select double-width printing (one line)* | :white_check_mark: |
| DC4 | Cancel double-width printing (one line) | :white_check_mark: |
| ESC W | Turn double-width printing on/off | :white_check_mark: |
| ESC w | Turn double-height printing on/off | :white_check_mark: |
| | | |
| Control-code character printing | | |
| ESC ( ^ | Print data as characters | :white_check_mark: |
| ESC 6 | Enable printing of upper control codes | :white_check_mark: |
| ESC 7 | Enable upper control codes | :white_check_mark: |
| ESC I | Enable printing of control codes | :white_check_mark: |
| ESC m | Select printing of upper control codes* | :white_check_mark: |
| | | |
| Mechanical control | | |
| ESC EM | Control paper loading/ejecting | :white_check_mark: |
| ESC U | Turn unidirectional mode on/off | :no_entry_sign: |
| ESC < | Unidirectional mode (one line)* | :no_entry_sign: |
| BEL | Beeper* | :no_entry_sign: |
| ESC 8 | Disable paper-out detector* | :no_entry_sign: |
| ESC 9 | Enable paper-out detector* | :no_entry_sign: |
| ESC s | Select low-speed mode* | :no_entry_sign: |
| | | |
| Printing color and graphics | | |
| ESC ( G | Select graphics mode | :white_check_mark: |
| ESC ( i | Select MicroWeave print mode | :white_check_mark: |
| ESC . | Print raster graphics | :white_check_mark: |
| ESC . 2 | Enter TIFF compressed mode | :white_check_mark: |
| ESC * | Select bit image | :white_check_mark: |
| ESC ? | Reassign bit-image mode* | :white_check_mark: |
| ESC K | Select 60-dpi graphics* | :white_check_mark: |
| ESC L | Select 120-dpi graphics* | :white_check_mark: |
| ESC Y | Select 120-dpi, double-speed graphics* | :white_check_mark: |
| ESC Z | Select 240-dpi graphics* | :white_check_mark: |
| ESC ^ | Select 60/120-dpi, 9-pin graphics | :white_check_mark: |
| ESC r | Select printing color | :white_check_mark: |
| | | |
| Printing bar codes | | |
| ESC ( B | Bar code setup and print | :white_check_mark: |
| | | |
| Data and memory control | | |
| ESC @ | Initialize printer | :white_check_mark: |
| CAN | Cancel line* | :white_large_square: |
| DEL | Delete last character in buffer* | :white_large_square: |
| DC1 | Select printer* | :no_entry_sign: |
| DC3 | Deselect printer* | :no_entry_sign: |
| ESC # | Cancel MSB control* | :white_large_square: |
| ESC = | Set MSB to 0* | :white_large_square: |
| ESC > | Set MSB to 1* | :white_large_square: |
| | | |
| Deleted commands | | |
| ESC j | Reverse paper feed* | :no_entry_sign: |
| ESC i | Select immediate print mode* | :no_entry_sign: |
| | | |
| Binary mode commands for ESC . 2 | | |
| raster graphics compression mode | | |
| `<XFER>` | Transfer raster graphics data | :white_check_mark: |
| `<MOVX>` | Set relative horizontal position | :white_check_mark: |
| `<MOVY>` | Set relative vertical position | :white_check_mark: |
| `<COLR>` | Select printing color | :white_check_mark: |
| `<CR>` | Carriage return to left-most print position | :white_check_mark: |
| `<EXIT>` | Exit TIFF compressed mode | :white_check_mark: |
| `<MOVXBYTE>` | Set <MOVX> unit to 8 dots | :white_check_mark: |
| `<MOVXDOT>` | Set <MOVX> unit to 1 dot | :white_check_mark: |
</details>
- [x] **Advanced font support**
Specify in advance the fonts you wish to use. 14 different fonts can be
specified, each in 2 versions (fixed and proportional fonts), for a total of 28 fonts.
Use system-installed or custom fonts.
Text enhancements (strikethrough, underline, highlight, etc.) are supported.
<div align="center"><figure>
<img src="./images/fonts.webp">
<img src="./images/character_styles.webp"><br>
<figcaption>Fonts examples & character style implementations.</figcaption>
</figure></div>
- [x] **Several rendering modes for graphic commands**
Points can be rendered as dots or rectangles.
In all cases, the file is vectorized (infinitely scalable).
<div align="center"><figure>
<img src="./images/graphism_render_1.webp">
<img src="./images/graphism_render_2.webp">
<img src="./images/graphism_render_2_details.webp"><br>
<figcaption>Graphic element magnifications. Two ways of rendering.</figcaption>
</figure></div>
NB: Rendering as an image is not yet available, but such a result can be
obtained with GhostScript for this task (see examples).
- [x] **Searchable text**
Text remains as text, not as images.
This makes content search and indexing possible.
- [x] **Wide range of encodings available**
A major effort has been made to ensure that the essential encodings of this
era and more, are also supported by EscaPy. It's easy to add to this list.
Contributions are welcome.
<br><br>
Characters that can be printed in the place of the intervals dedicated to
control characters, and international characters (National Replacement
Character Set) are also injected into the encoding tables.
<div align="center"><figure>
<img src="./images/encodings.webp"><br>
<figcaption>Support for many common encodings.</figcaption>
</figure></div>
NB: It is still necessary to ensure that the fonts used support the selected
character sets.
<details>
<summary><b>See details</b></summary>
- [x] PC437 (US)
- [x] PC437 Greek
- [x] PC932 (Japanese)
- [x] PC850 (Multilingual)
- [ ] PC851 (Greek)
- [ ] PC853 (Turkish)
- [x] PC855 (Cyrillic)
- [x] PC860 (Portugal)
- [x] PC863 (Canada-French)
- [x] PC865 (Norway)
- [x] PC852 (East Europe)
- [x] PC857 (Turkish)
- [x] PC862 (Hebrew)
- [x] PC864 (Arabic)
- [x] PC AR864
- [x] PC866 (Russian)
- [ ] (Bulgarian ASCII****)
- [ ] PC866 LAT. (Latvian)
- [x] PC869 (Greek)
- [ ] USSR GOST (Russian)
- [ ] ECMA-94-1
- [x] KU42 (K.U. Thai)
- [ ] TIS11 (TS 988 Thai)
- [ ] TIS18 (GENERAL Thai)
- [ ] TIS17 (SIC STD. Thai)
- [ ] TIS13 (IBM STD. Thai)
- [ ] TIS16 (SIC OLD Thai)
- [x] PC861 (Iceland)
- [x] BRASCII
- [x] Abicomp
- [x] MAZOWIA (Poland)
- [ ] Code MJK (CSFR)
- [x] ISO8859-7 (Latin/Greek)
- [x] ISO8859-1 (Latin 1)
- [ ] TSM/WIN (Thai system manager)
- [x] ISO Latin 1T (Turkish)
- [ ] Bulgaria
- [ ] Hebrew 7
- [ ] Hebrew 8
- [x] Roman 8
- [x] PC774 (Lithuania)
- [ ] Estonia (Estonia)
- [x] ISCII
- [x] PC-ISCII
- [ ] PC APTEC
- [ ] PC708
- [x] PC720
- [ ] OCR-B
- [x] ISO Latin 1
- [x] ISO 8859-2 (ISO Latin 2)
- [x] ISO Latin 7 (Greek)
</details>
- [x] **Page formats**
47 portrait formats and their landscape equivalents are predefined.
Custom sizes are also available.
- [x] **User-defined characters support (ESC/P2 only)**
A user can send customized bitmap characters to the printer.
A mapping file will be generated to map the received characters to modern
unicode codes (see examples).
- [x] **Enhanced reliability thanks to testing (~100%)**
EscaPy is an implementation of a standard made up of over 600 pages
covered by almost 300 tests.
A coverage rate close to 100% eliminates most of the erratic behavior that
a non-rigorously tested application can produce.
However, a coverage rate of 100% does not guarantee that the program
rigorously follows the standard, but that its behavior is most often in line
with what the developer expected when he designed it.
- [x] **Facilitated development**
The code is fully documented to facilitate maintenance and enhancements.
## ⚙ Setup
### Installation
All operating systems should be supported, although this project is mainly
developed for a GNU-Linux system as an everyday computer.
Simple installation from PyPI (**beware, the package name is not the project name!**):
```bash
$ pip install pyscape
```
Installation from sources :
```bash
$ pip install .
```
Install the project in editable mode for developpers :
```bash
$ make install
# Or
$ pip install -e .[dev]
```
Installation on Debian :
- Download the `.deb` file in the [releases section of this repo](https://github.com/ysard/escapy/releases).
- Then :
```bash
apt install ./escapy_1.0.0-2_all.deb
```
### Usage
```bash
$ escapy -h
usage: [-h] [--pins [PINS]] [--single_sheets | --no-single_sheets] [-o [OUTPUT]]
[-c [CONFIG]] [-db [USERDEF_DB_FILEPATH]] [-v]
esc_prn
positional arguments:
esc_prn ESC raw printer file. - to read from stdin.
options:
-h, --help show this help message and exit
--pins [PINS] number of needles of the print head (9, 24, 48). Leave it unset
for ESCP2 modern printers. (default: unset)
--single_sheets, --no-single_sheets
single-sheets or continuous paper. (default: single-sheets)
-o [OUTPUT], --output [OUTPUT]
PDF output file. - to write on stdout. (default: output.pdf)
-c [CONFIG], --config [CONFIG]
configuration file to use. (default: ./escapy.conf,
~/.local/share/escapy/escapy.conf)
-db [USERDEF_DB_FILEPATH], --userdef_db_filepath [USERDEF_DB_FILEPATH]
mappings between user-defined chararacter codes and unicode.
(default: ./user_defined_mapping.json)
-v, --version show program's version number and exit
```
NB : The configuration file supplied by the application contains all the
information needed to configure the virtual printer (margins, page formats, etc.),
fonts and folders.
### Examples
Standard input/output streams are active, so it is possible to chain tools :
```bash
$ cat my_file.prn | escapy - -o - > my_pdf.pdf
```
For example, to convert the generated PDF into a TIFF image with GhostScript :
```bash
$ cat my_file.prn | escapy - -o - | \
gs -dBATCH -dNOPAUSE -dSAFER \
-dNoSeparationFiles -dSimulateOverprint=true -sDEVICE=tiffsep -r720 \
-sOutputFile=out-%d.tiff -
```
## :newspaper: Configuration file
The configuration file supplied by the application contains all the information
needed to configure the virtual printer (margins, page formats, etc.),
fonts and folders.
By default, the `escapy.conf` file is searched for in the current folder.
If it doesn't exist, it is searched for in the standard software configuration
folder on your system (see below).
This folder is created if it doesn't already exist.
On GNU/Linux systems:
`~/.local/share/escapy/`
On Windows systems:
`C:\\Users\\<YOUR_USERNAME>\\AppData\\Local\\escapy`
On MacOS systems:
`/Users/<YOUR_USERNAME>/Library/Application Support/escapy`
The default file is in the repository folder: [data](./escapy/data/).
## :abc: Fonts
For reasons of licensing and personal preference, EscaPy does not embed fonts
(except for a minimal version of Courier and Helvetica).
<details>
<summary><b>List of fonts that can be embedded in Epson printers</b></summary>
* Roman
* Sans serif
* Courier
* Prestige
* Script
* OCR-B
* OCR-A
* Orator
* Orator-S
* Script C
</details>
Free fonts a proprietary equivalents :
| Proprietary | Free -> | | | | |
|------------------------------------------------------------|-------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------|------------------------------------------------------------|----------------------------------------------------------------|
| Courier New | Liberation Mono | [Noto Sans Mono](https://fonts.google.com/noto) | [FreeMono](https://en.wikipedia.org/wiki/GNU_FreeFont) | [Fira Mono, Fira Code](https://github.com/tonsky/FiraCode) | [Roboto Mono](https://fonts.google.com/specimen/Roboto+Mono) |
| Times New Roman | Liberation Serif | Noto Serif | FreeSerif | [FiraGO](https://github.com/bBoxType/FiraGO) | [Roboto Serif](https://fonts.google.com/specimen/Roboto+Serif) |
| Arial | Liberation Sans | Noto Sans | FreeSans | [Fira Sans](https://fonts.google.com/specimen/Fira+Sans) | [Roboto](https://fonts.google.com/specimen/Roboto) |
| [OCR-A / OCR-B fonts](https://en.wikipedia.org/wiki/OCR-B) | [Square <br/>stroke ends OCR-A & OCR-B](https://ctan.org/tex-archive/fonts/ocr-b?lang=en) | [Rounded ends & extended character coverage OCR-B](https://web.archive.org/web/20190328165040/https://wehtt.am/ocr-b/) |
See also Recursive free font :
- [Recursive Mono](https://github.com/arrowtype/recursive)
- [Recursive Sans](https://github.com/arrowtype/recursive)
Free bitmap-style fonts :
- [Fixedsys Excelsior](https://github.com/kika/fixedsys)
- [Orp-Font](https://github.com/MicahElliott/Orp-Font)
- [~390 Atari fonts](https://github.com/a8bit/EightBit-Atari-Fonts)
Non-free fonts or fonts with restrictive licenses, often with a very limited
character set, but close to the embedded fonts on Epson printers :
- [Script C](https://online-fonts.com/fonts/scriptc)
- [Romant](https://online-fonts.com/fonts/romant)
- [Prestige](https://online-fonts.com/fonts/prestige)
- [OCR-A](https://online-fonts.com/fonts/ocrarus-lyajka)
- [OCR-B](https://www.freefontdownload.org/en/ocr-b-regular.font)
---
Noto, FreeFont and Fira fonts are normally installed on most systems, but can also be
installed manually with the following command (on Debian systems and derivatives):
```bash
$ apt install fonts-noto fonts-freefont-ttf fonts-firacode
```
The same goes for Liberation fonts:
```bash
$ apt install fonts-liberation
```
Windows proprietary fonts can be installed with the following command:
```bash
$ apt install ttf-mscorefonts-installer
```
More generally, think of the `fnt` tool as a package manager for managing and
installing fonts.
## :a: User-defined characters
A JSON file is created and updated when custom characters are found.
The user must specify the desired character in the unicode character set.
The changes will be applied to the PDF by restarting the software.
Example:
```
{
"83e1a70_1": {
"mode": 1,
"proportional_spacing": false,
"scripting": null,
"1": "\ufffd"
}
}
```
Here, a character is defined under the unique key `83e1a70_1`;
the character with code `1` in the table is momentarily associated with
the undefined character `\ufffd` (`UNDEFINED`).
A modification to match this code with the character `♫` could be as follows:
```
{
"83e1a70_1": {
"mode": 1,
"proportional_spacing": false,
"scripting": null,
"1": "♫"
}
}
```
By default, the JSON file (`user_defined_mapping.json`) is created in the current
folder, but this can be changed in the configuration file.
A folder containing the image of the bitmap character received can also be created.
## :u7a7a: Unsupported encodings (Chinese, Japanese, etc.)
The ESC/P and ESC/P2 standards do not seem to support Chinese or Japanese
languages (encodings were apparently not provided for). However, some language
evolutions (ESC/POS, ESC/P-K, ESC/P J84) and printers do support this.
While in theory these languages can be implemented, their documentation remains
hard to find and is beyond the scope of the current project.
See [Wikipedia - ESC variants](https://en.wikipedia.org/wiki/ESC/P#Variants).
The easiest way to achieve this is to use the printer in graphics mode
(raster or bitimage) instead of text mode.
## :trophy: Acknowledgements
- The management of modern fonts and their display on our screens would not
have been possible without the work of French engineer
[Pierre Bézier (1910-1999)](https://en.wikipedia.org/wiki/Pierre_B%C3%A9zier),
who also, through his work at Renault, revolutionized computer-aided design (CAD).
- The Epson-Seiko teams of the 90's deserve our thanks for producing complete
documentation of the language interpreted by their printers.
## Absence of acknowledgements
Since the 2010s, Epson-Seiko (like so many other brands) tends to no longer publish
language evolutions or advanced technical specifications for their machines.
The brand tends to consider that this is now an industrial secret and none of
your business.
In an ethical world, we wouldn't have to decipher these proprietary protocols.
If you too feel that this is not appropriate, then you should consider
manufacturers who respect your right to repair/modify what you own.
## 👏🏻 Contributions
This project is open for any contribution! Any bug report can be posted by
opening an [issue](https://github.com/ysard/EscaPy/issues).
## :book: License
EscaPy is distributed under two licenses: one for community use and the other
for commercial use.
### Community = Free and Open Source
EscaPy is released under the AGPL (Affero General Public License).
### Commercial
The aim is to limit the uses integrated into proprietary devices whose vendors
do not participate in the project in an equitable way, and who are guilty of
any violation of the EscaPy license or of the free software used by EscaPy itself.
If you are interested in this license, please contact us.
<p align="right"><a href="#readme-top">Top ⬆️</a></p>
---
<div align="center">Built with ❤️ with <a href="https://github.com/luisvent/document_my_project">Document My Project</a></div>
Raw data
{
"_id": null,
"home_page": "https://github.com/ysard/escapy",
"name": "pyscape",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "printer, dotmatrix, escp2, escp, pdf",
"author": "Ysard",
"author_email": "ysard_git@gmx.fr",
"download_url": "https://files.pythonhosted.org/packages/53/34/40079786efbe963def5c7df151fe6824cee416e7a3b9a7c05f1c329c51b5/pyscape-1.0.1.tar.gz",
"platform": null,
"description": "[](https://github.com/ysard/escapy/releases/latest/)\n[](https://pypi.python.org/pypi/pyscape)\n[](https://pypi.python.org/pypi/pyscape)\n[](https://github.com/ysard/escapy/actions)\n[](https://interrogate.readthedocs.io/en/latest/)\n[](https://docs.pytest.org/en/latest/)\n[](https://github.com/ysard/escapy/blob/main/LICENCE)\n[](https://liberapay.com/Ysard/donate)\n<!--[](https://escapy.readthedocs.io/en/latest/)-->\n\n<a name=\"readme-top\"></a>\n\n<div align=\"center\">\n\n# EscaPy\n\nEscaPy is a **thoroughly tested** tool that **reliably** and almost\n**exhaustively** interprets the ESC/P and ESC/P2 command sets defined by Epson\n([Wikipedia - Epson ESC/P](https://en.wikipedia.org/wiki/ESC/P)), then converts\nthe data formerly intended for printers into a modern PDF file.\n\n</div>\n\n\n## Table of Contents\n <details>\n<summary>Open Contents</summary>\n\n- [EscaPy](#title)\n - [:information_source: About the Project](#information_source-about-the-project)\n - [:book: Foreword](#book-foreword)\n - [:bank: Donations](#bank-donations)\n - [:star: Features](#star-features)\n - [\u2699 Setup](#-setup)\n - [Installation](#installation)\n - [Usage](#usage)\n - [Examples](#examples)\n - [:newspaper: Configuration file](#newspaper-configuration-file)\n - [:abc: Fonts](#abc-fonts)\n - [:a: User-defined characters](#a-user-defined-characters)\n - [:u7a7a: Unsupported encodings (Chinese, Japanese, etc.)](#u7a7a-unsupported-encodings-chinese-japanese-etc)\n - [:trophy: Acknowledgements](#trophy-acknowledgements)\n - [Absence of acknowledgements](#absence-of-acknowledgements)\n - [\ud83d\udc4f\ud83c\udffb Contributions](#-contributions)\n - [:book: License](#book-license)\n</details>\n\n\n## :information_source: About the Project\n\n**TL;DR**: Your DOS system or emulator will be able to produce searchable\nPDF files.\nThis tool is compatible with files produced by the\n[Libre Printer](https://github.com/ysard/libre-printer) interface discussed below.\n\n\n## :book: Foreword\n\nNowadays, older equipment may still be in use in sectors such as medical or\nindustrial (machine tools). While the software of the old days were often\ndesigned to use dot-matrix printers exclusively, these printers can break down\nor can no longer be used due to a lack of consumables available on the market.\n\nAs a result, the entire system has to be replaced without justification.\n\nEscaPy generates PDF files from the raw data sent to the printer.\nFiles can therefore be stored permanently, printed on new hardware, indexed by\nan archiving system (text remains accessible) or simply consulted at any time.\n\nNote that data destined for the printer must be captured in some way.\nThe [Libre Printer](https://github.com/ysard/libre-printer) project accomplishes\nexactly this task by providing a software and hardware interface pretending\nto be a printer compatible with older hardware.\n\n\n## :bank: Donations\n\nEscaPy is a project that took ~2 months of full-time work and 12k+ lines\nincluding documentation & tests, for its first version.\nIf it has been useful to you in any way and you would like to contribute to its\ndevelopment, please follow the link below, with all thanks :\n\n[](https://liberapay.com/Ysard/donate)\n\n\n\n1EB6dc6YULzHR4TMqLi5fomZ6wmdP3N5cW\n\n\n## :star: Features\n\n- [x] **Advanced ESC/P ESC/P2 command set support**\n\n Nearly all commands are supported (text, graphics and barcodes).\n\n <details>\n <summary><b>See details</b></summary>\n\n *: Not recommended command.<br>\n :white_check_mark:: Implemented.<br>\n :heavy_exclamation_mark:: Not fully implemented.<br>\n :white_large_square:: Not implemented.<br>\n :no_entry_sign:: Will not be implemented.<br>\n\n | Setting the page format | | |\n |----------------------------------|---------------------------------------------|----------------------|\n | ESC ( C | Set page length in defined unit | :white_check_mark: |\n | ESC ( c | Set page format | :white_check_mark: |\n | ESC C | Set page length in lines | :white_check_mark: |\n | ESC C NUL | Set page length in inches | :white_check_mark: |\n | ESC N | Set bottom margin | :white_check_mark: |\n | ESC O | Cancel bottom margin | :white_check_mark: |\n | ESC Q | Set right margin | :white_check_mark: |\n | ESC l | Set left margin | :white_check_mark: |\n | | | |\n | Moving the print position | | |\n | CR | Carriage return | :white_check_mark: |\n | LF | Line feed | :white_check_mark: |\n | FF | Form feed | :white_check_mark: |\n | ESC $ | Set absolute horizontal print position | :white_check_mark: |\n | ESC \\ | Set relative horizontal print position | :white_check_mark: |\n | ESC ( V | Set absolute vertical print position | :white_check_mark: |\n | ESC ( v | Set relative vertical print position | :white_check_mark: |\n | ESC J | Advance print position vertically | :white_check_mark: |\n | HT | Tab horizontally | :white_check_mark: |\n | VT | Tab vertically | :white_check_mark: |\n | ESC f | Horizontal/vertical skip* | :white_check_mark: |\n | BS | Backspace* | :white_check_mark: |\n | | | |\n | Setting the units | | |\n | ESC ( U | Set unit | :white_check_mark: |\n | ESC 0 | Select 1/8-inch line spacing | :white_check_mark: |\n | ESC 2 | Select 1/6-inch line spacing | :white_check_mark: |\n | ESC 3 | Set n/180-inch line spacing | :white_check_mark: |\n | ESC 3 | Set n/216-inch line spacing | :white_check_mark: |\n | ESC + | Set n/360-inch line spacing | :white_check_mark: |\n | ESC A | Set n/60-inch line spacing* | :white_check_mark: |\n | ESC A | Set n/72-inch line spacing* | :white_check_mark: |\n | ESC 1 | Select 7/72-inch line spacing* | :white_check_mark: |\n | ESC D | Set horizontal tabs | :white_check_mark: |\n | ESC B | Set vertical tabs | :white_check_mark: |\n | ESC b | Set vertical tabs in VFU channels* | :white_large_square: |\n | ESC / | Select vertical tab channel* | :white_large_square: |\n | ESC e | Set fixed tab increment* | :white_large_square: |\n | ESC a | Select justification* | :white_large_square: |\n | | | |\n | Selecting characters | | |\n | ESC ( t | Assign character table | :white_check_mark: |\n | ESC t | Select character table | :white_check_mark: |\n | ESC R | Select an international character set | :white_check_mark: |\n | ESC & | Define user-defined characters | :heavy_exclamation_mark: |\n | ESC : | Copy ROM to RAM | :white_check_mark: |\n | ESC % | Select user-defined set | :white_check_mark: |\n | ESC x | Select LQ or draft | :white_check_mark: |\n | ESC x | Select NLQ or draft | :white_check_mark: |\n | ESC k | Select typeface | :white_check_mark: |\n | ESC X | Select font by pitch and point | :white_check_mark: |\n | ESC c | Set horizontal motion index (HMI) | :white_check_mark: |\n | ESC P | Select 10.5-point, 10-cpi | :white_check_mark: |\n | ESC P | Select 10-cpi | :white_check_mark: |\n | ESC M | Select 10.5-point, 12-cpi | :white_check_mark: |\n | ESC M | Select 12-cpi | :white_check_mark: |\n | ESC g | Select 10.5-point, 15-cpi | :white_check_mark: |\n | ESC g | Select 15-cpi | :white_check_mark: |\n | ESC p | Turn proportional mode on/off | :white_check_mark: |\n | ESC SP | Set intercharacter space | :white_check_mark: |\n | ESC E | Select bold font | :white_check_mark: |\n | ESC F | Cancel bold font | :white_check_mark: |\n | ESC 4 | Select italic font | :white_check_mark: |\n | ESC 5 | Cancel italic font | :white_check_mark: |\n | ESC ! | Master select | :white_check_mark: |\n | ESC G | Select double-strike printing | :white_check_mark: |\n | ESC H | Cancel double-strike printing | :white_check_mark: |\n | ESC - | Turn underline on/off | :white_check_mark: |\n | ESC ( - | Select line/score | :white_check_mark: |\n | ESC S | Select superscript/subscript printing | :white_check_mark: |\n | ESC T | Cancel superscript/subscript printing | :white_check_mark: |\n | ESC q | Select character style | :white_check_mark: |\n | SI | Select condensed printing | :white_check_mark: |\n | ESC SI | Select condensed printing* | :white_check_mark: |\n | DC2 | Cancel condensed printing | :white_check_mark: |\n | SO | Select double-width printing (one line) | :white_check_mark: |\n | ESC SO | Select double-width printing (one line)* | :white_check_mark: |\n | DC4 | Cancel double-width printing (one line) | :white_check_mark: |\n | ESC W | Turn double-width printing on/off | :white_check_mark: |\n | ESC w | Turn double-height printing on/off | :white_check_mark: |\n | | | |\n | Control-code character printing | | |\n | ESC ( ^ | Print data as characters | :white_check_mark: |\n | ESC 6 | Enable printing of upper control codes | :white_check_mark: |\n | ESC 7 | Enable upper control codes | :white_check_mark: |\n | ESC I | Enable printing of control codes | :white_check_mark: |\n | ESC m | Select printing of upper control codes* | :white_check_mark: |\n | | | |\n | Mechanical control | | |\n | ESC EM | Control paper loading/ejecting | :white_check_mark: |\n | ESC U | Turn unidirectional mode on/off | :no_entry_sign: |\n | ESC < | Unidirectional mode (one line)* | :no_entry_sign: |\n | BEL | Beeper* | :no_entry_sign: |\n | ESC 8 | Disable paper-out detector* | :no_entry_sign: |\n | ESC 9 | Enable paper-out detector* | :no_entry_sign: |\n | ESC s | Select low-speed mode* | :no_entry_sign: |\n | | | |\n | Printing color and graphics | | |\n | ESC ( G | Select graphics mode | :white_check_mark: |\n | ESC ( i | Select MicroWeave print mode | :white_check_mark: |\n | ESC . | Print raster graphics | :white_check_mark: |\n | ESC . 2 | Enter TIFF compressed mode | :white_check_mark: |\n | ESC * | Select bit image | :white_check_mark: |\n | ESC ? | Reassign bit-image mode* | :white_check_mark: |\n | ESC K | Select 60-dpi graphics* | :white_check_mark: |\n | ESC L | Select 120-dpi graphics* | :white_check_mark: |\n | ESC Y | Select 120-dpi, double-speed graphics* | :white_check_mark: |\n | ESC Z | Select 240-dpi graphics* | :white_check_mark: |\n | ESC ^ | Select 60/120-dpi, 9-pin graphics | :white_check_mark: |\n | ESC r | Select printing color | :white_check_mark: |\n | | | |\n | Printing bar codes | | |\n | ESC ( B | Bar code setup and print | :white_check_mark: |\n | | | |\n | Data and memory control | | |\n | ESC @ | Initialize printer | :white_check_mark: |\n | CAN | Cancel line* | :white_large_square: |\n | DEL | Delete last character in buffer* | :white_large_square: |\n | DC1 | Select printer* | :no_entry_sign: |\n | DC3 | Deselect printer* | :no_entry_sign: |\n | ESC # | Cancel MSB control* | :white_large_square: |\n | ESC = | Set MSB to 0* | :white_large_square: |\n | ESC > | Set MSB to 1* | :white_large_square: |\n | | | |\n | Deleted commands | | |\n | ESC j | Reverse paper feed* | :no_entry_sign: |\n | ESC i | Select immediate print mode* | :no_entry_sign: |\n | | | |\n | Binary mode commands for ESC . 2 | | |\n | raster graphics compression mode | | |\n | `<XFER>` | Transfer raster graphics data | :white_check_mark: |\n | `<MOVX>` | Set relative horizontal position | :white_check_mark: |\n | `<MOVY>` | Set relative vertical position | :white_check_mark: |\n | `<COLR>` | Select printing color | :white_check_mark: |\n | `<CR>` | Carriage return to left-most print position | :white_check_mark: |\n | `<EXIT>` | Exit TIFF compressed mode | :white_check_mark: |\n | `<MOVXBYTE>` | Set <MOVX> unit to 8 dots | :white_check_mark: |\n | `<MOVXDOT>` | Set <MOVX> unit to 1 dot | :white_check_mark: |\n\n </details>\n\n\n- [x] **Advanced font support**\n\n Specify in advance the fonts you wish to use. 14 different fonts can be\n specified, each in 2 versions (fixed and proportional fonts), for a total of 28 fonts.\n\n Use system-installed or custom fonts.\n\n Text enhancements (strikethrough, underline, highlight, etc.) are supported.\n\n <div align=\"center\"><figure>\n <img src=\"./images/fonts.webp\">\n <img src=\"./images/character_styles.webp\"><br>\n <figcaption>Fonts examples & character style implementations.</figcaption>\n </figure></div>\n\n\n- [x] **Several rendering modes for graphic commands**\n\n Points can be rendered as dots or rectangles.\n In all cases, the file is vectorized (infinitely scalable).\n\n <div align=\"center\"><figure>\n <img src=\"./images/graphism_render_1.webp\">\n <img src=\"./images/graphism_render_2.webp\">\n <img src=\"./images/graphism_render_2_details.webp\"><br>\n <figcaption>Graphic element magnifications. Two ways of rendering.</figcaption>\n </figure></div>\n\n NB: Rendering as an image is not yet available, but such a result can be\n obtained with GhostScript for this task (see examples).\n\n\n- [x] **Searchable text**\n\n Text remains as text, not as images.\n This makes content search and indexing possible.\n\n\n- [x] **Wide range of encodings available**\n\n A major effort has been made to ensure that the essential encodings of this\n era and more, are also supported by EscaPy. It's easy to add to this list.\n Contributions are welcome.\n <br><br>\n Characters that can be printed in the place of the intervals dedicated to\n control characters, and international characters (National Replacement\n Character Set) are also injected into the encoding tables.\n\n <div align=\"center\"><figure>\n <img src=\"./images/encodings.webp\"><br>\n <figcaption>Support for many common encodings.</figcaption>\n </figure></div>\n\n NB: It is still necessary to ensure that the fonts used support the selected\n character sets.\n\n <details>\n <summary><b>See details</b></summary>\n\n - [x] PC437 (US)\n - [x] PC437 Greek\n - [x] PC932 (Japanese)\n - [x] PC850 (Multilingual)\n - [ ] PC851 (Greek)\n - [ ] PC853 (Turkish)\n - [x] PC855 (Cyrillic)\n - [x] PC860 (Portugal)\n - [x] PC863 (Canada-French)\n - [x] PC865 (Norway)\n - [x] PC852 (East Europe)\n - [x] PC857 (Turkish)\n - [x] PC862 (Hebrew)\n - [x] PC864 (Arabic)\n - [x] PC AR864\n - [x] PC866 (Russian)\n - [ ] (Bulgarian ASCII****)\n - [ ] PC866 LAT. (Latvian)\n - [x] PC869 (Greek)\n - [ ] USSR GOST (Russian)\n - [ ] ECMA-94-1\n - [x] KU42 (K.U. Thai)\n - [ ] TIS11 (TS 988 Thai)\n - [ ] TIS18 (GENERAL Thai)\n - [ ] TIS17 (SIC STD. Thai)\n - [ ] TIS13 (IBM STD. Thai)\n - [ ] TIS16 (SIC OLD Thai)\n - [x] PC861 (Iceland)\n - [x] BRASCII\n - [x] Abicomp\n - [x] MAZOWIA (Poland)\n - [ ] Code MJK (CSFR)\n - [x] ISO8859-7 (Latin/Greek)\n - [x] ISO8859-1 (Latin 1)\n - [ ] TSM/WIN (Thai system manager)\n - [x] ISO Latin 1T (Turkish)\n - [ ] Bulgaria\n - [ ] Hebrew 7\n - [ ] Hebrew 8\n - [x] Roman 8\n - [x] PC774 (Lithuania)\n - [ ] Estonia (Estonia)\n - [x] ISCII\n - [x] PC-ISCII\n - [ ] PC APTEC\n - [ ] PC708\n - [x] PC720\n - [ ] OCR-B\n - [x] ISO Latin 1\n - [x] ISO 8859-2 (ISO Latin 2)\n - [x] ISO Latin 7 (Greek)\n </details>\n\n\n- [x] **Page formats**\n\n 47 portrait formats and their landscape equivalents are predefined.\n Custom sizes are also available.\n\n\n- [x] **User-defined characters support (ESC/P2 only)**\n\n A user can send customized bitmap characters to the printer.\n A mapping file will be generated to map the received characters to modern\n unicode codes (see examples).\n\n\n- [x] **Enhanced reliability thanks to testing (~100%)**\n\n EscaPy is an implementation of a standard made up of over 600 pages\n covered by almost 300 tests.\n\n A coverage rate close to 100% eliminates most of the erratic behavior that\n a non-rigorously tested application can produce.\n\n However, a coverage rate of 100% does not guarantee that the program\n rigorously follows the standard, but that its behavior is most often in line\n with what the developer expected when he designed it.\n\n\n- [x] **Facilitated development**\n\n The code is fully documented to facilitate maintenance and enhancements.\n\n\n## \u2699 Setup\n\n### Installation\n\nAll operating systems should be supported, although this project is mainly\ndeveloped for a GNU-Linux system as an everyday computer.\n\nSimple installation from PyPI (**beware, the package name is not the project name!**):\n```bash\n$ pip install pyscape\n```\n\nInstallation from sources :\n```bash\n$ pip install .\n```\n\nInstall the project in editable mode for developpers :\n```bash\n$ make install\n# Or\n$ pip install -e .[dev]\n```\n\nInstallation on Debian :\n- Download the `.deb` file in the [releases section of this repo](https://github.com/ysard/escapy/releases).\n- Then :\n```bash\napt install ./escapy_1.0.0-2_all.deb\n```\n\n\n### Usage\n\n```bash\n$ escapy -h\nusage: [-h] [--pins [PINS]] [--single_sheets | --no-single_sheets] [-o [OUTPUT]]\n [-c [CONFIG]] [-db [USERDEF_DB_FILEPATH]] [-v]\n esc_prn\n\npositional arguments:\n esc_prn ESC raw printer file. - to read from stdin.\n\noptions:\n -h, --help show this help message and exit\n --pins [PINS] number of needles of the print head (9, 24, 48). Leave it unset\n for ESCP2 modern printers. (default: unset)\n --single_sheets, --no-single_sheets\n single-sheets or continuous paper. (default: single-sheets)\n -o [OUTPUT], --output [OUTPUT]\n PDF output file. - to write on stdout. (default: output.pdf)\n -c [CONFIG], --config [CONFIG]\n configuration file to use. (default: ./escapy.conf,\n ~/.local/share/escapy/escapy.conf)\n -db [USERDEF_DB_FILEPATH], --userdef_db_filepath [USERDEF_DB_FILEPATH]\n mappings between user-defined chararacter codes and unicode.\n (default: ./user_defined_mapping.json)\n -v, --version show program's version number and exit\n```\n\nNB : The configuration file supplied by the application contains all the\ninformation needed to configure the virtual printer (margins, page formats, etc.),\nfonts and folders.\n\n### Examples\n\nStandard input/output streams are active, so it is possible to chain tools :\n\n```bash\n$ cat my_file.prn | escapy - -o - > my_pdf.pdf\n```\n\nFor example, to convert the generated PDF into a TIFF image with GhostScript :\n\n```bash\n$ cat my_file.prn | escapy - -o - | \\\ngs -dBATCH -dNOPAUSE -dSAFER \\\n-dNoSeparationFiles -dSimulateOverprint=true -sDEVICE=tiffsep -r720 \\\n-sOutputFile=out-%d.tiff -\n```\n\n## :newspaper: Configuration file\n\nThe configuration file supplied by the application contains all the information\nneeded to configure the virtual printer (margins, page formats, etc.),\nfonts and folders.\n\nBy default, the `escapy.conf` file is searched for in the current folder.\nIf it doesn't exist, it is searched for in the standard software configuration\nfolder on your system (see below).\nThis folder is created if it doesn't already exist.\n\nOn GNU/Linux systems:\n`~/.local/share/escapy/`\n\nOn Windows systems:\n`C:\\\\Users\\\\<YOUR_USERNAME>\\\\AppData\\\\Local\\\\escapy`\n\nOn MacOS systems:\n`/Users/<YOUR_USERNAME>/Library/Application Support/escapy`\n\nThe default file is in the repository folder: [data](./escapy/data/).\n\n## :abc: Fonts\n\nFor reasons of licensing and personal preference, EscaPy does not embed fonts\n(except for a minimal version of Courier and Helvetica).\n\n<details>\n<summary><b>List of fonts that can be embedded in Epson printers</b></summary>\n\n* Roman\n* Sans serif\n* Courier\n* Prestige\n* Script\n* OCR-B\n* OCR-A\n* Orator\n* Orator-S\n* Script C\n</details>\n\nFree fonts a proprietary equivalents :\n\n| Proprietary | Free -> | | | | |\n|------------------------------------------------------------|-------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------|------------------------------------------------------------|----------------------------------------------------------------|\n| Courier New | Liberation Mono | [Noto Sans Mono](https://fonts.google.com/noto) | [FreeMono](https://en.wikipedia.org/wiki/GNU_FreeFont) | [Fira Mono, Fira Code](https://github.com/tonsky/FiraCode) | [Roboto Mono](https://fonts.google.com/specimen/Roboto+Mono) |\n| Times New Roman | Liberation Serif | Noto Serif | FreeSerif | [FiraGO](https://github.com/bBoxType/FiraGO) | [Roboto Serif](https://fonts.google.com/specimen/Roboto+Serif) |\n| Arial | Liberation Sans | Noto Sans | FreeSans | [Fira Sans](https://fonts.google.com/specimen/Fira+Sans) | [Roboto](https://fonts.google.com/specimen/Roboto) |\n| [OCR-A / OCR-B fonts](https://en.wikipedia.org/wiki/OCR-B) | [Square <br/>stroke ends OCR-A & OCR-B](https://ctan.org/tex-archive/fonts/ocr-b?lang=en) | [Rounded ends & extended character coverage OCR-B](https://web.archive.org/web/20190328165040/https://wehtt.am/ocr-b/) |\n\nSee also Recursive free font :\n\n- [Recursive Mono](https://github.com/arrowtype/recursive)\n- [Recursive Sans](https://github.com/arrowtype/recursive)\n\nFree bitmap-style fonts :\n\n- [Fixedsys Excelsior](https://github.com/kika/fixedsys)\n- [Orp-Font](https://github.com/MicahElliott/Orp-Font)\n- [~390 Atari fonts](https://github.com/a8bit/EightBit-Atari-Fonts)\n\nNon-free fonts or fonts with restrictive licenses, often with a very limited\ncharacter set, but close to the embedded fonts on Epson printers :\n\n- [Script C](https://online-fonts.com/fonts/scriptc)\n- [Romant](https://online-fonts.com/fonts/romant)\n- [Prestige](https://online-fonts.com/fonts/prestige)\n- [OCR-A](https://online-fonts.com/fonts/ocrarus-lyajka)\n- [OCR-B](https://www.freefontdownload.org/en/ocr-b-regular.font)\n\n---\n\nNoto, FreeFont and Fira fonts are normally installed on most systems, but can also be\ninstalled manually with the following command (on Debian systems and derivatives):\n\n```bash\n$ apt install fonts-noto fonts-freefont-ttf fonts-firacode\n```\n\nThe same goes for Liberation fonts:\n```bash\n$ apt install fonts-liberation\n```\n\nWindows proprietary fonts can be installed with the following command:\n```bash\n$ apt install ttf-mscorefonts-installer\n```\n\nMore generally, think of the `fnt` tool as a package manager for managing and\ninstalling fonts.\n\n## :a: User-defined characters\n\nA JSON file is created and updated when custom characters are found.\nThe user must specify the desired character in the unicode character set.\nThe changes will be applied to the PDF by restarting the software.\n\nExample:\n```\n{\n \"83e1a70_1\": {\n \"mode\": 1,\n \"proportional_spacing\": false,\n \"scripting\": null,\n \"1\": \"\\ufffd\"\n }\n}\n```\n\nHere, a character is defined under the unique key `83e1a70_1`;\nthe character with code `1` in the table is momentarily associated with\nthe undefined character `\\ufffd` (`UNDEFINED`).\n\nA modification to match this code with the character `\u266b` could be as follows:\n```\n{\n \"83e1a70_1\": {\n \"mode\": 1,\n \"proportional_spacing\": false,\n \"scripting\": null,\n \"1\": \"\u266b\"\n }\n}\n```\n\nBy default, the JSON file (`user_defined_mapping.json`) is created in the current\nfolder, but this can be changed in the configuration file.\nA folder containing the image of the bitmap character received can also be created.\n\n## :u7a7a: Unsupported encodings (Chinese, Japanese, etc.)\n\nThe ESC/P and ESC/P2 standards do not seem to support Chinese or Japanese\nlanguages (encodings were apparently not provided for). However, some language\nevolutions (ESC/POS, ESC/P-K, ESC/P J84) and printers do support this.\nWhile in theory these languages can be implemented, their documentation remains\nhard to find and is beyond the scope of the current project.\nSee [Wikipedia - ESC variants](https://en.wikipedia.org/wiki/ESC/P#Variants).\n\nThe easiest way to achieve this is to use the printer in graphics mode\n(raster or bitimage) instead of text mode.\n\n\n## :trophy: Acknowledgements\n\n- The management of modern fonts and their display on our screens would not\nhave been possible without the work of French engineer\n[Pierre B\u00e9zier (1910-1999)](https://en.wikipedia.org/wiki/Pierre_B%C3%A9zier),\nwho also, through his work at Renault, revolutionized computer-aided design (CAD).\n\n- The Epson-Seiko teams of the 90's deserve our thanks for producing complete\ndocumentation of the language interpreted by their printers.\n\n\n## Absence of acknowledgements\n\nSince the 2010s, Epson-Seiko (like so many other brands) tends to no longer publish\nlanguage evolutions or advanced technical specifications for their machines.\nThe brand tends to consider that this is now an industrial secret and none of\nyour business.\n\nIn an ethical world, we wouldn't have to decipher these proprietary protocols.\nIf you too feel that this is not appropriate, then you should consider\nmanufacturers who respect your right to repair/modify what you own.\n\n\n## \ud83d\udc4f\ud83c\udffb Contributions\n\nThis project is open for any contribution! Any bug report can be posted by\nopening an [issue](https://github.com/ysard/EscaPy/issues).\n\n\n## :book: License\n\nEscaPy is distributed under two licenses: one for community use and the other\nfor commercial use.\n\n### Community = Free and Open Source\n\nEscaPy is released under the AGPL (Affero General Public License).\n\n### Commercial\n\nThe aim is to limit the uses integrated into proprietary devices whose vendors\ndo not participate in the project in an equitable way, and who are guilty of\nany violation of the EscaPy license or of the free software used by EscaPy itself.\n\nIf you are interested in this license, please contact us.\n\n<p align=\"right\"><a href=\"#readme-top\">Top \u2b06\ufe0f</a></p>\n\n---\n <div align=\"center\">Built with \u2764\ufe0f with <a href=\"https://github.com/luisvent/document_my_project\">Document My Project</a></div>\n",
"bugtrack_url": null,
"license": null,
"summary": "An advanced Python interpreter for ESC/P and ESC/P2 commands, efficiently and accurately converting your print workflows into precise vectorial PDFs.",
"version": "1.0.1",
"project_urls": {
"Homepage": "https://github.com/ysard/escapy"
},
"split_keywords": [
"printer",
" dotmatrix",
" escp2",
" escp",
" pdf"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a977fdbc25ef949e5cc602f19ec1d4bc8bb23eaec43ea45b26e81dcaeadb608f",
"md5": "4143decb36e507ec5d428035a04b0164",
"sha256": "2b1cf07401d21e70b84f0b387524c72342e40c4c1ef5008a4e4cf7caf5fbba14"
},
"downloads": -1,
"filename": "pyscape-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4143decb36e507ec5d428035a04b0164",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 106284,
"upload_time": "2025-02-02T20:31:43",
"upload_time_iso_8601": "2025-02-02T20:31:43.182404Z",
"url": "https://files.pythonhosted.org/packages/a9/77/fdbc25ef949e5cc602f19ec1d4bc8bb23eaec43ea45b26e81dcaeadb608f/pyscape-1.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "533440079786efbe963def5c7df151fe6824cee416e7a3b9a7c05f1c329c51b5",
"md5": "2141e8b0c02dc73a469df548af757dda",
"sha256": "d9a6695a7327c1ac062a089c6fc87f25c4471033a13ad18b74321fa8d1cdbf90"
},
"downloads": -1,
"filename": "pyscape-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "2141e8b0c02dc73a469df548af757dda",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 110993,
"upload_time": "2025-02-02T20:31:45",
"upload_time_iso_8601": "2025-02-02T20:31:45.381826Z",
"url": "https://files.pythonhosted.org/packages/53/34/40079786efbe963def5c7df151fe6824cee416e7a3b9a7c05f1c329c51b5/pyscape-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-02 20:31:45",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ysard",
"github_project": "escapy",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pyscape"
}