Skip to main content

strokeoutline

strokeoutline converts 2D centerlines into deterministic filled contours with constant or variable width. It is reusable geometry extracted from InkGrammar's stroke outlining engine, without glyph, shaping, OCR, or handwriting-model responsibilities.

Use it for vector brushes, pressure-like width profiles, centerline fonts, skeleton thickening, corridors, and other centerline-based applications. The MVP preserves current geometry behavior; see the documentation for its limitations and compatibility contracts.

Install

python -m pip install strokeoutline

For SVG path parsing, install the optional extra:

python -m pip install 'strokeoutline[svg]'

Documentation

The complete guides and deliberate API reference are in the documentation source:

Core example

from strokeoutline import Line, Path2D, Subpath, outline

path = Path2D((Subpath((Line((0, 0), (10, 0)),)),))

result = outline(path, width=4.0)
print(result.bounds)
for contour in result.contours:
    print(contour)

Width is the full stroke diameter, not radius. Width profiles may be a positive constant, a strictly increasing piecewise-linear knot sequence spanning 0..1, or a callable.

For compatibility, normalized width progress is based on segment index, not physical arc length:

u = (segment_index + local_segment_parameter) / segment_count

Progress restarts at zero for each independent subpath. See width profiles for details.

Integration boundary

StrokeOutline owns centerline-to-contour geometry. Integrations such as InkGrammar own shaped-text traversal and domain-specific adaptation, and should call StrokeOutline rather than copy its outlining algorithm. The core package does not require FontTools; only the optional strokeoutline.svg adapter does.

Development

python -m pip install -e '.[dev]'
ruff format --check .
ruff check .
pytest
python docs/make.py html
python docs/make.py doctest

License

Apache-2.0.

Metadata

Release files for strokeoutline 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for strokeoutline 0.1.0
File Size Uploaded Provenance Actions
strokeoutline-0.1.0.tar.gz 41.5 kB Without provenance Details for strokeoutline-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for strokeoutline 0.1.0
File Interpreter ABI Platform Actions
strokeoutline-0.1.0-py3-none-any.whl Python 3 none any Details for strokeoutline-0.1.0-py3-none-any.whl

Total release size: 59.4 kB

Release files / strokeoutline-0.1.0.tar.gz

Download URL strokeoutline-0.1.0.tar.gz
Size 41.5 kB
Tags Source
SHA-256 checksum
How to use checksums
41057ddd30daac50b6926b883e9cf0ea9322ca5fd8521fd09c8413525d49f53f
BLAKE2b-256 checksum
How to use checksums
75736bad68656eb868dbe346a87d64f985e3ae21f3f42ead07aaf51115090ae6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / strokeoutline-0.1.0-py3-none-any.whl

Download URL strokeoutline-0.1.0-py3-none-any.whl
Size 17.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b78f14459bafdae38f1758366f27c0235925544d595f9b236a32bb14655eb95
BLAKE2b-256 checksum
How to use checksums
4f4baac90f1ff9a3c76266719a44858768cbba66fbf50814c5d9e00c21923b23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for strokeoutline 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page