FontParts-based library for SMuFL font scripting
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file smufolib-0.3.0.tar.gz
.
File metadata
- Download URL: smufolib-0.3.0.tar.gz
- Upload date:
- Size: 46.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10f7f2ac4b0fbb0570a0856571cd26a5abe201aba262917e6f76967b021da1a0 |
|
MD5 | 7ee2728df0b5b170a010dbaf72a8be0d |
|
BLAKE2b-256 | 64d27ddc7edddcf39cfae9b6934fc6daf6998057f4a1c6c4cd8d0f88bb5995f0 |
File details
Details for the file smufolib-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: smufolib-0.3.0-py3-none-any.whl
- Upload date:
- Size: 54.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bada44004943f8ce2cbc022e91dbb99a03e95f9fa4d75172de2d03c2edb37e79 |
|
MD5 | 6d6ab874c620a53dc2acbe9e0bf98065 |
|
BLAKE2b-256 | 08fb852fa964a99a4a61b92dec8a452594e3a9b35fc6ec7dbf6a1fb641d92446 |