Interrogate and manipulate UFO, TTF and OTF fonts with a common interface
Project description
Babelfont allows you to interact with a variety of font formats - UFO, TTF/OTF with PostScript outlines, and TTF/OTF with TrueType outlines - without needing to worry about what’s going on underneath. It is an extension to fontParts, on which it relies for OTF support.
The usual way to interact with TrueType/OpenType fonts is through the fonttools library; this provides access to every part of a font, but it does so in a low-level way which requires the user to not only be familiar with the internal structure of the font, but to care about the different representations of information possible within the font.
Babelfont is a bridge between the friendly, high-level interface of fontParts and the TTF/OTF support of fonttools. It allows you to do things like this:
from babelfont import OpenFont font = OpenFont("Myfont.otf") # Or TTF. Or UFO... glyph = font.layers[0]["space"] glyph.width = glyph.width / 2 font.save("Myfont-halfspace.otf")
Currently you need to save the font in the same format in which you loaded it - babelfont cannot yet be used for conversion between UFO and TTF.
For full details of the interface, see https://fontparts.robotools.dev/en/stable/objectref/objects/font.html
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
Hashes for babelfont-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8323a9f78f4527de678003172ffbfb843fd2d5ece7eec8ca221994703651fdb5 |
|
MD5 | 4960f9bc35498f3aed849787a36526b5 |
|
BLAKE2b-256 | f72bba261c4bc352492bedc960a58c94c49997a864ab53c3cb69fd7c032c7f44 |