Metadata-Version: 2.4
Name: picosvg
Version: 0.23.0
Summary: Exploratory utility for svg simplification, meant for use playing with COLR fonts
Author: Rod S
Author-email: rsheeter@google.com
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: absl-py>=0.9.0
Requires-Dist: lxml>=4.0
Requires-Dist: skia-pathops>=0.6.0
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-clarity; extra == "test"
Provides-Extra: lint
Requires-Dist: black; extra == "lint"
Requires-Dist: pyrefly; extra == "lint"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-clarity; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: pyrefly; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: description
Dynamic: description-content-type
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

[![CI Build Status](https://github.com/googlefonts/picosvg/workflows/Continuous%20Test%20+%20Deploy/badge.svg)](https://github.com/googlefonts/picosvg/actions/workflows/ci.yml?query=workflow%3ATest)
[![PyPI](https://img.shields.io/pypi/v/picosvg.svg)](https://pypi.org/project/picosvg/)
[![Dependencies](https://badgen.net/github/dependabot/googlefonts/picosvg)](https://github.com/googlefonts/picosvg/network/updates)

# picosvg

Tool to simplify SVGs. Converts an input svg into a "pico" svg:

*   Exactly 1 `<defs>` element, first child of root
*   Only gradients defined under `<defs>`
*   After the initial `<defs>`, only `<g>` and `<path>`
    * `<g>` is eliminated when possible, but may be retained for opacity
*   Only absolute coordinates
*   Only commands that specify full coordinates, no shorthand (H, S, etc)

Clip paths and strokes are rendered into equivalent paths using [Skia](https://skia.org/) via [skia-pathops](https://github.com/fonttools/skia-pathops), `<use>` references are materialized, etc.

Some SVG features are not supported, of particular note:

*   `<filter>`
*   `<mask>`

Usage:

```shell
pip install -e .
picosvg mysvg.svg
```

Requires Python 3.10 or greater.

## Test

Install the dev dependencies specified in [`extras_require`](https://github.com/googlefonts/picosvg/blob/main/setup.py#L36-L40).

```shell
pip install -e .[dev]
pytest
```

If you use zsh, it will prompt an error(`zsh: no matches found: .[dev]`). Please use the following command:

```shell
pip install -e '.[dev]'
```

You can also use [pytest](https://docs.pytest.org/) to test the specified files individually.

```shell
pytest tests/svg_test.py
```

If you need to test a certain function (for example: test_topicosvg), please execute:

```shell
pytest tests/svg_test.py::test_topicosvg
```

If you need to display detailed diff information, please execute:
```shell
pytest tests/svg_test.py::test_topicosvg --vv
```
## Releasing

See https://googlefonts.github.io/python#make-a-release.
