Skip to main content

FontParts-based library for SMuFL font scripting

Project description

PyPI - Version Python Version from PEP 621 TOML PyPI - License Read the Docs GitHub Actions Workflow Status Codecov

SMufoLib: Where SMuFL meets UFO

SMufoLib is a small Python library designed to aid in font development and scripting specific to the Standard Music Font Layout (SMuFL). As an extension of the FontParts API, SMufoLib relies on the platform and application independent Unified Font Object (UFO) format and the command line, rather than any particular font editor.

Documentation

SMufoLib’s documentation is available at smufolib.readthedocs.io.

Installation

SMufoLib requires Python 3.10 or later. It is listed in the Python Package Index (PyPI) and can be installed with pip:

$ python -m pip install smufolib

Scripts

SMufoLib comes bundled with several useful scripts for building SMuFL metadata files, calculating engraving defaults from glyphs, importing identification attributes and more.

Scripts may be run either directly from the command line or imported as regular python modules, passing in any arguments in the familiar manner to each platform.

As an example, check for missing or superflous SMuFL anchors and mark discrepant glyphs by running the checkAnchors script with the --mark flag directly from the command line:

$ check-anchors path/to/my/font.ufo --mark

Positional arguments and available options can be listed by running the help command on the script:

$ check-anchors --help

usage: check-anchors [-h] [-F FONTDATA] [-m] [-c COLOR COLOR COLOR COLOR] [-v]
                     font

Find missing or superfluous SMuFL anchors.

positional arguments:
   font                  path to UFO file

options:
   -h, --help           show this help message and exit
   -F FONTDATA, --font-data FONTDATA
                        path to font metadata file (default: <Request '/url/path
                        /to/reference/font/metadata.json' ('/file/path/to/refere
                        nce/font/metadata.json') at 4536666000>)
   -m, --mark           apply defined color values to objects (default: False)
   -c COLOR COLOR COLOR COLOR, --color COLOR COLOR COLOR COLOR
                        list of RGBA color values (default: None)
   -v, --verbose        make output verbose (default: False)

Alternatively, scripts can be imported as modules in Python:

from bin.checkAnchors import checkAnchors

checkAnchors(mark=True)

This imports and executes the script’s program function checkAnchors from the script module of the same name.

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

smufolib-0.4.0.tar.gz (61.0 kB view details)

Uploaded Source

Built Distribution

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

smufolib-0.4.0-py3-none-any.whl (68.2 kB view details)

Uploaded Python 3

File details

Details for the file smufolib-0.4.0.tar.gz.

File metadata

  • Download URL: smufolib-0.4.0.tar.gz
  • Upload date:
  • Size: 61.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for smufolib-0.4.0.tar.gz
Algorithm Hash digest
SHA256 9a3d3c6f616ad0bb6e275955259d3a303e6a442f33fc70018e4d9aa298529154
MD5 15bcb7d39d670718232e378e4b2265c8
BLAKE2b-256 8d36a4fe30af46761df80c9bf420fa12700728abfd9a91d41927a32489b92d9b

See more details on using hashes here.

Provenance

The following attestation bundles were made for smufolib-0.4.0.tar.gz:

Publisher: publish-package.yml on knutnergaard/smufolib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file smufolib-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: smufolib-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 68.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for smufolib-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb1b339c1a6394a5db15f96bc6c99700ce8e7afb53f9cb4c7a00ef48be38546c
MD5 63541b70ba220c0a93593993701b7867
BLAKE2b-256 052a9a4e696ec4703b8f510aa239b09ddd6eccf82edab3f7a7ed94670a1f3c33

See more details on using hashes here.

Provenance

The following attestation bundles were made for smufolib-0.4.0-py3-none-any.whl:

Publisher: publish-package.yml on knutnergaard/smufolib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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