Metadata-Version: 2.3
Name: pyxelxl
Version: 0.0.9
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Dist: pyxel >=2.0.0
Requires-Dist: numpy ~=1.25.0
Summary: Bitmap fonts, and in the future more for Pyxel.
Author-email: RuneBlaze <runeblaze@protonmail.com>
Requires-Python: >=3.7
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# PyxelXL

Fast TTF drawing for [Pyxel](https://github.com/kitao/pyxel), including support for antialiasing. This library is in the works to become a general purpose "bloated" set of extensions for Pyxel, but for now it only includes a font rendering extension.

![alt screenshot](demo/bare_screenshot.png)

## Installation

You can install PyxelXL using pip:

```bash
pip install pyxelxl
```

## Usage

To use a TTF font in your Pyxel application:

```python
import pyxel
from pyxelxl.font import Font

roboto = Font("path_to_fonts/Roboto/Roboto-Regular.ttf")
zh_font = Font("path_to_fonts/zpix.ttf")

class App:
    def __init__(self):
        pyxel.init(160, 120, title="PyxelXL Example")
        pyxel.run(self.update, self.draw)

    def update(self):
        pass

    def draw(self):
        pyxel.cls(1)
        roboto.draw(0, 0, "Hello, World! Antialiased", 7, font_size=16) # Roboto is not a pixel font...
        zh_font.draw(0, 40, "我能吞下玻璃而不伤身体", 7, font_size=12) # This is a pixel font so will look pixel-perfect
        roboto.draw(0, 80, "Hello, World! Not antialiased", 15, font_size=16, threshold=128)

App()
```

## Advantages

 - Fast
 - Easy multi-font size support
 - Anti-aliasing algorithm for non-pixel fonts
