Skip to main content

FontParts based library for SMuFL font scripting

Project description

SMufoLib is a small library of objects and functions designed to aid in font development specific to the Standard Music Font Layout (SMuFL).

The objects in SMufoLib are wrapped around FontParts, the replacement for RoboFab, still in development.

Documentation

SMufoLib’s documentation is presently limited to its docstrings. However, the library should be easy to grasp for anyone familiar with FontParts and SMuFL in addition to Python.

Installation

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

$ python -m pip install smufolib

Configuration

Project specific settings are defined in smufolib.cfg. This file is located inside the smufolib folder in python site packages by default, but can be moved to the home folder or a specific location defined in the environment variable SMUFOLIB_CFG or as INI_FILEPATH inside config.py is divided between the following sections:

Font Paths

Filesystem (or URL) paths to various font-related files.

SMuFL Paths

Filesystem (or URL) paths to various SMuFL-related files.

SMuFL URLs

Specific URL paths to various SMuFL-related files.

About interpolation

In the above sections interpolation strings ${option} and ${section:option} may be used to refer to an option in the current or specific foreign section respectively. This is particularly useful when specifying pathnames:

[Font Paths]
directory = ~/Documents/UFO
ufo = ${directory}/my_font.ufo (result: ~/Documents/UFO/my_font.ufo)
...
[SMuFL Paths]
...
classes.json = ${Font Paths:directory}/classes.json
(result: ~/Documents/UFO/classes.json)

For more information, see: https://docs.python.org/3/library/configparser.html#interpolation-of-values

Engraving Defaults

Values for SMuFLs engravingDefaults metadata structure. Values left empty will be calculated automatically. See help for smufolib.engraving.getEngravingDefaults.

Mark Color

Color values for glyph.rGlyph.markColor.

Scripts

SMufoLib comes bundled with several useful functions and scripts for building SMuFL metadata files, extracting engraving defaults, exporting/importing annotation and more.

Scripts can be run directly from the console, passing in (optional) arguments in a familiar manner. As an example, check for missing or superflous SMuFL anchors with checkAnchors as follows:

$ checkAnchors --mark True

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.0.2.tar.gz (15.4 kB view hashes)

Uploaded Source

Built Distribution

SMufoLib-0.0.2-py3-none-any.whl (22.4 kB view hashes)

Uploaded Python 3

Supported by

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