Metadata-Version: 2.4
Name: papyrium
Version: 0.2.0
Summary: A virtual vintage printer: the bytes a computer sends its printer, printed as a 1980s dot-matrix printer would print them.
Author-email: Robert Smallshire <robert@smallshire.org.uk>
License-Expression: MIT
Project-URL: Homepage, https://github.com/rob-smallshire/papyrium
Project-URL: Repository, https://github.com/rob-smallshire/papyrium
Project-URL: Issues, https://github.com/rob-smallshire/papyrium/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Printing
Classifier: Topic :: System :: Emulators
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: asyoulikeit>=1.5.1
Requires-Dist: click>=8.1.7
Requires-Dist: exit-codes>=1.3
Requires-Dist: ifaddr>=0.2
Requires-Dist: pillow>=10.0
Requires-Dist: stevedore>=5.0
Requires-Dist: zeroconf>=0.151
Dynamic: license-file

<!-- Generated by scripts/render_readme.py from a template; edit the template, not this file. -->
# Papyrium

[![CI](https://github.com/rob-smallshire/papyrium/actions/workflows/ci.yml/badge.svg)](https://github.com/rob-smallshire/papyrium/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue)](https://github.com/rob-smallshire/papyrium/blob/master/LICENSE)

Papyrium is a virtual vintage printer. It runs as a headless service,
receives the bytes a computer sends to its printer, interprets them as a
chosen period printer would, lays the result out on emulated paper, and
writes the pages as PNG images and PDF documents, dot for dot.

<p>
<img src="https://raw.githubusercontent.com/rob-smallshire/papyrium/master/docs/images/ledger.png" alt="A condensed ledger report printed by the Epson FX-80 on green-bar listing paper" width="100%">
</p>
<p>
<img src="https://raw.githubusercontent.com/rob-smallshire/papyrium/master/docs/images/letter.png" alt="A letter printed by the Brother M-1109 in near letter quality" width="100%">
</p>

The printers are 9-pin dot-matrix printers of the 1980s, the Epson FX-80
and LX-800, the Brother M-1109 and the Star LC-10, speaking Epson's ESC/P, and
the IBM Proprinter II, speaking IBM's Proprinter language. The first client is
Beebium, the BBC Micro emulator, but Papyrium knows nothing about the
computer on the other end: any emulator, or real hardware behind a
network adapter, can drive it.

## Printers

Each printer model has a demonstration page, printed here by Papyrium
itself; `papyrium demo MODEL` prints one.

<table>
<tr>
<td width="17%" valign="top"><a href="https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/model/brother_m1109/"><img src="https://raw.githubusercontent.com/rob-smallshire/papyrium/master/docs/images/demo-top-brother-m1109.png" alt="The top of the brother-m1109 demonstration page" width="100%"></a><br><code>brother-m1109</code></td>
<td width="17%" valign="top"><a href="https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/model/epson_fx80/"><img src="https://raw.githubusercontent.com/rob-smallshire/papyrium/master/docs/images/demo-top-epson-fx80.png" alt="The top of the epson-fx80 demonstration page" width="100%"></a><br><code>epson-fx80</code></td>
<td width="17%" valign="top"><a href="https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/model/epson_lx800/"><img src="https://raw.githubusercontent.com/rob-smallshire/papyrium/master/docs/images/demo-top-epson-lx800.png" alt="The top of the epson-lx800 demonstration page" width="100%"></a><br><code>epson-lx800</code></td>
<td width="17%" valign="top"><a href="https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/model/ibm_proprinter_ii/"><img src="https://raw.githubusercontent.com/rob-smallshire/papyrium/master/docs/images/demo-top-ibm-proprinter-ii.png" alt="The top of the ibm-proprinter-ii demonstration page" width="100%"></a><br><code>ibm-proprinter-ii</code></td>
<td width="17%" valign="top"><a href="https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/model/star_lc10/"><img src="https://raw.githubusercontent.com/rob-smallshire/papyrium/master/docs/images/demo-top-star-lc10.png" alt="The top of the star-lc10 demonstration page" width="100%"></a><br><code>star-lc10</code></td>
<td width="17%" valign="top"><a href="https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/model/star_lc10/"><img src="https://raw.githubusercontent.com/rob-smallshire/papyrium/master/docs/images/demo-top-star-lc10-colour.png" alt="The top of the star-lc10-colour demonstration page" width="100%"></a><br><code>star-lc10-colour</code></td>
</tr>
</table>

## Quick start

With [uv](https://docs.astral.sh/uv/), run it straight from PyPI:

```sh
uvx papyrium serve
```

or install the `papyrium` command for good with `uv tool install papyrium`
(or `pipx install papyrium`, or `pip install papyrium`). The one
`papyrium` distribution brings the command and every printer model, font,
transport and output.

From a checkout:

```sh
git clone https://github.com/rob-smallshire/papyrium.git
cd papyrium
uv sync
uv run papyrium serve
```

This listens on `localhost:9100` (raw TCP, the JetDirect convention) as an
Epson FX-80, and writes each job into `papyrium-jobs/job-NNNN/`:

| File | Contents |
|---|---|
| `capture.prn` | Every byte received, exactly as sent |
| `job.json` | When the job started and ended, why it ended, and the printer setup |
| `page-0001.png`, ... | Each page, written as the paper is ejected |
| `job.pdf` | The whole job, written when the job ends |

Print something to it:

```sh
printf 'HELLO FROM PAPYRIUM\r\n\x0c' | nc localhost 9100
```

A job ends after five seconds without bytes (`--idle-timeout`), or when
the service stops. A disconnect never ends a job: an emulator may hold one
connection open for its whole life.

## Printers, paper and fonts

```
$ papyrium list-models
                                     Models                                     
┏━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Name              ┃ Description                                              ┃
┡━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ brother-m1109     │ Brother M-1109: an 80-column, 9-pin dot-matrix printer   │
│                   │ in its Mode I.                                           │
│ epson-fx80        │ Epson FX-80: an 80-column, 9-pin dot-matrix printer      │
│                   │ speaking ESC/P.                                          │
│ epson-lx800       │ Epson LX-800: an 80-column, 9-pin dot-matrix printer     │
│                   │ speaking ESC/P.                                          │
│ ibm-proprinter-ii │ IBM Proprinter II: an 80-column, 9-wire dot-matrix       │
│                   │ printer speaking                                         │
│ star-lc10         │ Star LC-10: an 80-column, 9-pin dot-matrix printer       │
│                   │ speaking ESC/P or,                                       │
│ star-lc10-colour  │ Star LC-10 Colour: the LC-10 with a four-colour ribbon.  │
└───────────────────┴──────────────────────────────────────────────────────────┘

$ papyrium list-fonts
                                     Fonts                                      
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Name                                 ┃ Description                           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ draft-9                              │ An original 9-pin draft font in the   │
│                                      │ style of 1980s dot-matrix printers.   │
│ lc10-block-graphics                  │ The Star LC-10's IBM block graphics,  │
│                                      │ extracted from its firmware ROM.      │
│ lc10-draft                           │ The Star LC-10's pica draft font,     │
│                                      │ made as the printer makes it.         │
│ lc10-draft-elite                     │ The Star LC-10's elite draft font,    │
│                                      │ extracted from its firmware ROM.      │
│ lc10-nlq-courier                     │ The Star LC-10's NLQ Courier in pica, │
│                                      │ extracted from its firmware ROM.      │
│ lc10-nlq-courier-elite               │ The Star LC-10's NLQ Courier in       │
│                                      │ elite, extracted from its firmware    │
│                                      │ ROM.                                  │
│ lc10-nlq-orator                      │ The Star LC-10's NLQ Orator with      │
│                                      │ lower case in pica, from its firmware │
│                                      │ ROM.                                  │
│ lc10-nlq-orator-elite                │ The Star LC-10's NLQ Orator with      │
│                                      │ lower case in elite, from its         │
│                                      │ firmware ROM.                         │
│ lc10-nlq-orator-small-capitals       │ The Star LC-10's NLQ Orator with      │
│                                      │ small capitals in pica, from its      │
│                                      │ firmware ROM.                         │
│ lc10-nlq-orator-small-capitals-elite │ The Star LC-10's NLQ Orator with      │
│                                      │ small capitals in elite, from its     │
│                                      │ firmware ROM.                         │
│ lc10-nlq-sanserif                    │ The Star LC-10's NLQ Sanserif in      │
│                                      │ pica, extracted from its firmware     │
│                                      │ ROM.                                  │
│ lc10-nlq-sanserif-elite              │ The Star LC-10's NLQ Sanserif in      │
│                                      │ elite, extracted from its firmware    │
│                                      │ ROM.                                  │
│ lx800-draft                          │ The Epson LX-800's draft font,        │
│                                      │ extracted from its firmware ROM.      │
│ lx800-nlq-roman                      │ The Epson LX-800's NLQ Roman font,    │
│                                      │ extracted from its firmware ROM.      │
│ m1109-draft                          │ The Brother M-1109's draft font,      │
│                                      │ reconstructed from printed output.    │
│ m1109-nlq                            │ The Brother M-1109's NLQ font,        │
│                                      │ reconstructed from printed output.    │
└──────────────────────────────────────┴───────────────────────────────────────┘
```

Choose a printer with `--model` and set its options with `-M KEY=VALUE`;
`papyrium describe-model NAME` describes a model and its options, which
set its DIP switches and its paper. For example, an M-1109 printing near
letter quality from power on, on blue-bar listing paper:

```sh
uv run papyrium serve --model brother-m1109 -M near-letter-quality=yes -M stationery=blue-bar
```

The paper can be a plain `sheet`, continuous `fanfold` with its tear-off
strips and feed holes, or listing paper: `green-bar`, `blue-bar` or
`music-ruled`. A font stands in for each printer's character ROM:
`draft-9`, the FX-80's, is an original design; the M-1109's are
reconstructed from its printed output; and the LX-800's and LC-10's are
extracted from their firmware, the LC-10 making some of its typefaces from
others as the printer does. The Proprinter II borrows the LC-10's until
its own are to hand. Any font can be replaced by a dot font file, with
`-M font=PATH`.

## Printing from a BBC Micro in Beebium

```sh
uv run papyrium serve
/path/to/beebium/build/src/server/beebium-model-b --tcp-printer host=localhost:port=9100
```

On the BBC:

```
*FX6,0
*FX5,1
VDU 2
PRINT "HELLO"
VDU 1,12
VDU 3
```

`*FX5,1` selects the parallel printer. The BBC normally suppresses line
feeds to the printer and sends CR alone; `*FX6,0` lets them through. If you
would rather leave the BBC at its defaults, switch on the printer's auto
line feed DIP switch instead:

```sh
uv run papyrium serve -M auto-line-feed=yes
```

Escape sequences go to the printer with `VDU 1`, so `VDU 1,27,1,69` turns
on emphasized printing (`ESC E`).

## Finding Papyrium on the network

`--advertise` announces the printer on the local network with multicast
DNS, as Bonjour and Avahi announce network printers, so that a sender,
such as a bridge from a real computer's printer port, can find it without
being given an address:

```sh
uv run papyrium serve --model brother-m1109 --advertise --name "Desk M-1109"
```

It appears as a raw TCP printer, a `_pdl-datastream._tcp` service. Its TXT
record names it a Papyrium printer (`note=Papyrium virtual printer`, and
`ty=Brother M-1109 (Papyrium)`), so a client can tell it from a real
printer, and carries the printer's `uuid`, which stays the same across
restarts and renames. The UUID is kept in `printer.json` in the output
directory; `--name` defaults to the model's name with "(Papyrium)".

Advertising makes the printer listen on every interface unless a host is
given with `-T host=`. Anyone on the network can then send it jobs, as with
any network printer. A printer only this machine can reach is not
advertised, and says so. A desktop that adds the printer from its printer
dialog must print to it in ESC/P, not PostScript or PCL.

## Commands

| Command | Purpose |
|---|---|
| `papyrium serve` | Run a printer until interrupted |
| `papyrium render JOB_OR_CAPTURE` | Print a captured job again, from a job directory or a `.prn` file |
| `papyrium demo MODEL` | Print a printer model's demonstration page, showing what it can do |
| `papyrium list-jobs` | List captured jobs |
| `papyrium list-models`, `describe-model NAME` | The printer models installed, and their options |
| `papyrium list-transports`, `list-languages`, `list-fonts`, `list-outputs`, `list-advertisers` | The other plug-ins installed |

Options are passed as `KEY=VALUE`: `-T` for the transport (`-T port=9101`),
`-M` for the printer model (`-M character-set=uk`), and
`-O OUTPUT.KEY=VALUE` for an output (`-O png.dpi=300`). Choose outputs with
`-o png -o pdf`. Reports such as `list-jobs` print as a table, or as TSV or
JSON with `--as tsv` or `--as json`.

Replaying a capture with the same printer setup always gives identical
pages; `render` on a job directory uses the setup recorded in its
`job.json`. `serve --capture-only` captures jobs without printing
them, and needs no printer model installed: each job records the model and
options asked for, so it can be printed later on a machine that has it.

## How it is built

Papyrium is a framework of independent, pluggable axes. Each is an
entry-point extension point, so a separately distributed package can add
to it, its modules joining the `papyrium` namespace beside these:

| Axis | Plug-in | Description | Module |
|---|---|---|---|
| Transports deliver bytes | `raw-tcp` | Raw TCP printing, by default on port 9100 | [`papyrium.transport.raw_tcp`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/transport/raw_tcp/) |
| Languages interpret them | `escp` | Epson ESC/P, as spoken by 9-pin dot-matrix printers such as the FX-80 | [`papyrium.language.escp`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/language/escp/) |
|  | `proprinter` | The IBM Proprinter's language, as the 9-wire Proprinter II speaks it | [`papyrium.language.proprinter`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/language/proprinter/) |
| Printer models are what the user chooses | `brother-m1109` | Brother M-1109: an 80-column, 9-pin dot-matrix printer in its Mode I | [`papyrium.model.brother_m1109`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/model/brother_m1109/) |
|  | `epson-fx80` | Epson FX-80: an 80-column, 9-pin dot-matrix printer speaking ESC/P | [`papyrium.model.epson_fx80`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/model/epson_fx80/) |
|  | `epson-lx800` | Epson LX-800: an 80-column, 9-pin dot-matrix printer speaking ESC/P | [`papyrium.model.epson_lx800`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/model/epson_lx800/) |
|  | `ibm-proprinter-ii` | IBM Proprinter II: an 80-column, 9-wire dot-matrix printer speaking | [`papyrium.model.ibm_proprinter_ii`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/model/ibm_proprinter_ii/) |
|  | `star-lc10` | Star LC-10: an 80-column, 9-pin dot-matrix printer speaking ESC/P or, | [`papyrium.model.star_lc10`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/model/star_lc10/) |
|  | `star-lc10-colour` | Star LC-10 Colour: the LC-10 with a four-colour ribbon | [`papyrium.model.star_lc10`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/model/star_lc10/) |
| Fonts stand in for character ROMs | `draft-9` | An original 9-pin draft font in the style of 1980s dot-matrix printers | [`papyrium.font.draft_9`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/font/draft_9/) |
|  | `lc10-block-graphics` | The Star LC-10's IBM block graphics, extracted from its firmware ROM | [`papyrium.font.lc10`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/font/lc10/) |
|  | `lc10-draft` | The Star LC-10's pica draft font, made as the printer makes it | [`papyrium.font.lc10`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/font/lc10/) |
|  | `lc10-draft-elite` | The Star LC-10's elite draft font, extracted from its firmware ROM | [`papyrium.font.lc10`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/font/lc10/) |
|  | `lc10-nlq-courier` | The Star LC-10's NLQ Courier in pica, extracted from its firmware ROM | [`papyrium.font.lc10`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/font/lc10/) |
|  | `lc10-nlq-courier-elite` | The Star LC-10's NLQ Courier in elite, extracted from its firmware ROM | [`papyrium.font.lc10`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/font/lc10/) |
|  | `lc10-nlq-orator` | The Star LC-10's NLQ Orator with lower case in pica, from its firmware ROM | [`papyrium.font.lc10`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/font/lc10/) |
|  | `lc10-nlq-orator-elite` | The Star LC-10's NLQ Orator with lower case in elite, from its firmware ROM | [`papyrium.font.lc10`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/font/lc10/) |
|  | `lc10-nlq-orator-small-capitals` | The Star LC-10's NLQ Orator with small capitals in pica, from its firmware ROM | [`papyrium.font.lc10`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/font/lc10/) |
|  | `lc10-nlq-orator-small-capitals-elite` | The Star LC-10's NLQ Orator with small capitals in elite, from its firmware ROM | [`papyrium.font.lc10`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/font/lc10/) |
|  | `lc10-nlq-sanserif` | The Star LC-10's NLQ Sanserif in pica, extracted from its firmware ROM | [`papyrium.font.lc10`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/font/lc10/) |
|  | `lc10-nlq-sanserif-elite` | The Star LC-10's NLQ Sanserif in elite, extracted from its firmware ROM | [`papyrium.font.lc10`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/font/lc10/) |
|  | `lx800-draft` | The Epson LX-800's draft font, extracted from its firmware ROM | [`papyrium.font.lx800`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/font/lx800/) |
|  | `lx800-nlq-roman` | The Epson LX-800's NLQ Roman font, extracted from its firmware ROM | [`papyrium.font.lx800`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/font/lx800/) |
|  | `m1109-draft` | The Brother M-1109's draft font, reconstructed from printed output | [`papyrium.font.m1109`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/font/m1109/) |
|  | `m1109-nlq` | The Brother M-1109's NLQ font, reconstructed from printed output | [`papyrium.font.m1109`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/font/m1109/) |
| Outputs write pages | `pdf` | One PDF per job, one page per printed page, every dot a vector dot | [`papyrium.output.pdf`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/output/pdf/) |
|  | `png` | PNG images, one per page, with each struck dot drawn as a dot | [`papyrium.output.png`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/output/png/) |
| Advertisers announce printers | `mdns` | Announces printers with multicast DNS, as Bonjour and Avahi do | [`papyrium.advertiser.mdns`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/advertiser/mdns/) |

The modules live under `src/papyrium/`, an implicit namespace package,
and their tests under `tests/`, in the same arrangement:

| Module | Contents |
|---|---|
| [`papyrium.exception`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/exception/) | Categorised exceptions and CLI error-reporting boundary for Papyrium |
| [`papyrium.extension`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/extension/) | Generic entry-point plug-in machinery shared by every Papyrium extension axis |
| [`papyrium.core`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/core/) | Papyrium's core: the page model, printer models, jobs, spooling and the plug-in axes |
| [`papyrium.transport.raw_tcp`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/transport/raw_tcp/) | Raw TCP transport: the JetDirect-style port 9100 byte stream |
| [`papyrium.language.escp`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/language/escp/) | The Epson ESC/P printer language for 9-pin dot-matrix printers |
| [`papyrium.language.proprinter`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/language/proprinter/) | The IBM Proprinter's printer language, for its 9-wire printers |
| [`papyrium.model.brother_m1109`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/model/brother_m1109/) | The Brother M-1109 9-pin dot-matrix printer |
| [`papyrium.model.epson_fx80`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/model/epson_fx80/) | The Epson FX-80 9-pin dot-matrix printer |
| [`papyrium.model.epson_lx800`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/model/epson_lx800/) | The Epson LX-800 9-pin dot-matrix printer |
| [`papyrium.model.ibm_proprinter_ii`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/model/ibm_proprinter_ii/) | The IBM Proprinter II 9-wire dot-matrix printer |
| [`papyrium.model.star_lc10`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/model/star_lc10/) | The Star LC-10 and LC-10 Colour 9-pin dot-matrix printers |
| [`papyrium.font.draft_9`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/font/draft_9/) | draft-9: a 9-pin dot-matrix font designed for Papyrium |
| [`papyrium.font.lc10`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/font/lc10/) | The Star LC-10's draft and near letter quality fonts, from its firmware |
| [`papyrium.font.lx800`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/font/lx800/) | The Epson LX-800's draft and near letter quality Roman fonts, from its firmware |
| [`papyrium.font.m1109`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/font/m1109/) | The Brother M-1109's draft and NLQ fonts, reconstructed from its printed output |
| [`papyrium.output.pdf`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/output/pdf/) | PDF output: each job as one document, each dot as a vector dot |
| [`papyrium.output.png`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/output/png/) | PNG output: one greyscale raster image per page |
| [`papyrium.advertiser.mdns`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/advertiser/mdns/) | Announcing Papyrium printers on the local network with multicast DNS |
| [`papyrium.cli`](https://github.com/rob-smallshire/papyrium/blob/master/src/papyrium/cli/) | The ``papyrium`` command: run a virtual vintage printer and inspect its jobs |

`docs/specification.md` is the design as handed over from Beebium.
`docs/epson-fx80.md`, `docs/epson-lx800.md`, `docs/brother-m1109.md` and
`docs/star-lc-10.md` record the behaviour Papyrium follows, from the
manufacturers' manuals, and `CLAUDE.md` records the working practices.

## Development

```sh
uv sync
uv run pytest
uv run pre-commit install
```

The golden tests replay the captures in each printer model's tests'
`golden/` directory and compare every page with a pinned image. The end-to-end
tests that drive a real Beebium BBC Micro are in `integration/beebium/`;
their module docstring gives the command to run them. `oracles/` compares
Papyrium with independent interpreters run as separate programs:
`uv run pytest oracles/escapy`.

This README and the printer models' READMEs are generated by
`scripts/render_readme.py` from the templates in
`scripts/readme-templates/` and beside the modules
(`src/papyrium/**/README.md.j2`), running the examples in
`scripts/readme-examples/` against Papyrium's own code. The
pre-commit hook regenerates them, so edit the templates, not the READMEs.

## Licence

Papyrium is released under the MIT licence; see [`LICENSE`](https://github.com/rob-smallshire/papyrium/blob/master/LICENSE).

Epson, Brother and the other printer and computer names in this project
are trademarks of their owners, used only to identify the printers that
Papyrium emulates. Papyrium is not affiliated with or endorsed by them.
