Metadata-Version: 2.4
Name: cairometal
Version: 0.1.0
Summary: A pycairo-compatible 2D vector-graphics backend that renders on the Apple GPU via Metal. Independent project — not affiliated with the cairo project or pycairo.
Author-email: Yu Yao-Hsing <euler.yu@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/yu314-coder/cairometal
Project-URL: Source, https://github.com/yu314-coder/cairometal
Project-URL: Issues, https://github.com/yu314-coder/cairometal/issues
Keywords: cairo,pycairo,metal,gpu,graphics,2d,vector,apple,macos
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Environment :: GPU
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 :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# cairometal

**A [pycairo](https://pycairo.readthedocs.io/)-compatible 2D vector-graphics backend that renders on the Apple GPU via Metal.**

> **Independent project — not affiliated with the [cairo](https://cairographics.org) graphics library or the official `pycairo` binding.** It reimplements a compatible surface/context API on top of Metal.

## Requirements

- **macOS** (Apple Silicon). Metal is an Apple framework; there are no Linux/Windows builds.
- Python **3.10+**.

## Install

```bash
pip install cairometal
```

Wheels are published per-CPython-version for macOS arm64. There is no on-the-fly
compilation at install time — you get a prebuilt binary.

## Usage

The API mirrors pycairo, so existing pycairo code largely works by changing the
import:

```python
import cairometal as cairo

surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 256, 256)
ctx = cairo.Context(surface)

ctx.set_source_rgb(0.13, 0.42, 0.96)
ctx.rectangle(32, 32, 192, 192)
ctx.fill()

ctx.set_source_rgb(1, 1, 1)
ctx.move_to(60, 140)
ctx.set_font_size(40)
ctx.show_text("Metal")

surface.write_to_png("out.png")   # rasterized on the GPU
```

## What it is

`cairometal` implements cairo's drawing model — paths, fills, strokes, clips,
groups, gradients, text, image surfaces, PNG output — with the rasterization
running on the GPU through Metal. It's useful where you have GPU-bound 2D vector
work; for light/typical cairo workloads the CPU `pycairo` is perfectly fine.

## License

MIT — see [LICENSE](LICENSE).
