Metadata-Version: 2.4
Name: pillow-yaff
Version: 0.1.0
Summary: YAFF bitmap font support for Pillow, without modifying Pillow
Project-URL: Specification, https://github.com/robhagemans/monobit
Author: Endre Szabo
License-Expression: MIT
License-File: LICENSE
Keywords: Imaging,Pillow,bitmap fonts,fonts,yaff
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Text Processing :: Fonts
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: pillow>=12.0.0
Provides-Extra: test
Requires-Dist: pytest; extra == 'test'
Description-Content-Type: text/markdown

# pillow-yaff

YAFF bitmap font support for [Pillow](https://python-pillow.org/), as a
standalone package that requires **no changes to Pillow itself**.

[YAFF](https://github.com/robhagemans/monobit) is a human-readable bitmap
font format supporting proportional glyph widths and per-glyph kerning.

`pillow-yaff` provides a font object that implements the same duck-typed
interface Pillow's own font classes do (`getbbox`, `getlength`, `getmask`,
`getmask2`), so it can be passed directly as the `font=` argument to
`PIL.ImageDraw` or `PIL.ImageText` on an unmodified, pip-installed Pillow.

## Usage

```python
import pillow_yaff
from PIL import Image, ImageDraw

font = pillow_yaff.load("my_font.yaff")

im = Image.new("RGB", (100, 30), "white")
draw = ImageDraw.Draw(im)
draw.text((5, 5), "Hello", fill="black", font=font)
im.save("out.png")
```

`pillow_yaff.load()` accepts a path (`str`, `bytes`, or `os.PathLike`) or an
open binary file object.

## Requirements

- Pillow >= 12.0.0 (needs `PIL.ImageText`)
- Python >= 3.10

## Development

```bash
pip install -e .[test]
pytest
```

CI (`.github/workflows/test.yml`) runs the test suite on Python 3.10-3.14
across Linux/macOS/Windows on every push and pull request, and builds the
sdist/wheel to catch packaging errors early.

