Skip to main content

Python tools for Sutton SignWriting font visualization in SVG and PNG.

Project description

sutton-signwriting-font

Source Code on GitHub Docs Gitter

Spec DOI

PyPI PyPI - Downloads CI

sutton-signwriting-font is a Python library that generates SVG and PNG images for individual symbols, complete signs, and structured text. The library covers the entire set of the International SignWritnig Alphabet 2010 (ISWA 2010).

This library builds on sutton-signwriting-core for parsing Formal SignWriting in ASCII (FSW) and SignWriting in Unicode (SWU), and uses an SQLite database of SVG fragments to compose self-contained visualizations. See draft-slevinski-formal-signwriting for detailed specification.

Author: Steve Slevinski
Channel: YouTube
Support: Patreon
Donate: sutton-signwriting.io

Useful Links


Installation

pip install sutton-signwriting-font

Usage

from sutton_signwriting_core.render import (
    fsw_symbol_svg, fsw_sign_svg,
    fsw_columns_svg, fsw_symbol_png
)

# Symbol SVG
svg = fsw_symbol_svg('S20500-C')
# Returns SVG string

# Sign SVG
svg = fsw_sign_svg('M525x535S2e748483x510S10011501x466S2e704510x500S10019476x475')
# Returns SVG string

# Text SVG
svg_list = fsw_columns_svg(
    'AS14c20S27106M518x529S14c20481x471S27106503x489 AS18701S1870aS2e734S20500M518x533S1870a489x515S18701482x490S20500508x496S2e734500x468 S38800464x496',
    {'height': 250, 'width': 150, 'pad': 20}
)
# Returns list of SVG strings (one per column)

# Symbol PNG
png_bytes: bytes = fsw_symbol_png('S20500', {'width': 256})
# Returns PNG bytes

All functions are fully typed, validated, and documented with Python-style docstrings (Google format). Run help(fsw_symbol_svg) for details.


Development

# 1. Clone the repo
git clone https://github.com/sutton-signwriting/font-py.git
cd font-py

# 2. Install Poetry (if you don’t have it)
curl -sSL https://install.python-poetry.org | python3 -
export PATH="$HOME/.local/bin:$PATH"

# 3. Create the virtual environment and install deps
poetry install

# 4. Activate the environment (Poetry 2+)
poetry env activate
#   (copy and execute the returned command)

# 5. Run the test suite
pytest -v

# 6. Code coverage and HTML report
pytest --cov
pytest -v --cov=sutton_signwriting_font --cov-report=html
pytest --cov=sutton_signwriting_font --cov-report=xml

# 7. Lint / format / type-check
black .
ruff check .
mypy src

# 8. Check / fix security issues
poetry run pip-audit
poetry update

# 9. Update Version string
pyproject.toml:version = "1.0.1"
src/sutton_signwriting_font/__init__.py:__version__ = "1.0.1"
sphinx-docs/source/conf.py:release = "1.0.1"
sphinx-docs/source/conf.py:version = "1.0"

# 10. Create HTML documentation
cd sphinx-docs
sphinx-build -b html -a -E source/ ../docs/

# 11. Build distributions
poetry build

# 12. Publish to pypi
poetry publish

# 13. Git commit, push, and tag
git commit -m "message"
git push origin main
git tag v1.0.1 && git push --tags

License

MIT – see LICENSE for details.

Maintained by Steve Slevinski – Slevinski@signwriting.org


SignWriting Resources

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sutton_signwriting_font-1.0.1.tar.gz (13.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sutton_signwriting_font-1.0.1-py3-none-any.whl (13.6 MB view details)

Uploaded Python 3

File details

Details for the file sutton_signwriting_font-1.0.1.tar.gz.

File metadata

  • Download URL: sutton_signwriting_font-1.0.1.tar.gz
  • Upload date:
  • Size: 13.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.10.12 Linux/6.6.87.2-microsoft-standard-WSL2

File hashes

Hashes for sutton_signwriting_font-1.0.1.tar.gz
Algorithm Hash digest
SHA256 8bae7e4f62dcf8d6d2f05cecfaf609d48bce8526fbc4870b9e81ee710a21534f
MD5 bf91beede7bdfc8394300aeee99684ce
BLAKE2b-256 dba271e07e7cfc840e7697ff78e186771e19d6982438c5bde241211dde9f7f35

See more details on using hashes here.

File details

Details for the file sutton_signwriting_font-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: sutton_signwriting_font-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 13.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.10.12 Linux/6.6.87.2-microsoft-standard-WSL2

File hashes

Hashes for sutton_signwriting_font-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a007b3b33a1e6dd8d4ceef4f0d7b921c12a28c0c2f330d7b10dbb87d8e269661
MD5 f3eebb90ffa4e86735ccec8ece2c8ba2
BLAKE2b-256 d586372dc4e9d560fb8170f2be2d51931534b54d0e1439538dba8661cc769407

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page