Skip to content

felipesanches/babelfont

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

babelfont

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

About

Interrogate and manipulate UFO, TTF and OTF fonts with a common interface

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%