Skip to content
项目

关于

Helps simplify SVG files. Intended for use as part of a font build.

设计与媒体

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
0
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

CI Build Status PyPI Dependencies

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 via skia-pathops, <use> references are materialized, etc.

Some SVG features are not supported, of particular note:

  • <filter>
  • <mask>

Usage:

pip install -e .
picosvg mysvg.svg

Requires Python 3.10 or greater.

Test

Install the dev dependencies specified in extras_require.

pip install -e .[dev]
pytest

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

pip install -e '.[dev]'

You can also use pytest to test the specified files individually.

pytest tests/svg_test.py

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

pytest tests/svg_test.py::test_topicosvg

If you need to display detailed diff information, please execute:

pytest tests/svg_test.py::test_topicosvg --vv

Releasing

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

探索相关项目

加载中…