Skip to main content

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


Download files

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

Source Distribution

babelfont-0.0.2.tar.gz (13.8 kB view hashes)

Uploaded Source

Built Distribution

babelfont-0.0.2-py3-none-any.whl (16.9 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