Skip to main content

A bridge from Glyphs source files (.glyphs) to UFOs

Project description

Travis Build Status PyPI Version Codecov

glyphsLib

This library provides a bridge from Glyphs source files (.glyphs) to UFOs via defcon.

The main methods for conversion are found in __init__.py. Intermediate data can be accessed without actually writing UFOs, if needed.

Write and return UFOs

Masters:

master_dir = 'master_ufos'
ufos = glyphsLib.build_masters('MyFont.glyphs', master_dir)

Interpolated instances (depends on MutatorMath):

master_dir = 'master_ufos'
instance_dir = 'instance_ufos'
ufos = glyphsLib.build_instances('MyFont.glyphs', master_dir, instance_dir)

Load UFO objects without writing

ufos = glyphsLib.load_to_ufos('MyFont.glyphs')

Read and write Glyphs data as Python objects

with open('MyFont.glyphs', 'rb') as glyphs_file:
    font = glyphsLib.load(glyphs_file)

with open('MyFont.glyphs', 'wb') as glyphs_file:
    glyphsLib.dump(font, glyphs_file)

The glyphsLib.classes module aims to provide an interface similar to Glyphs.app’s Python Scripting API.

Note that currently not all the classes and methods may be fully implemented. We try to keep up to date, but if you find something that is missing or does not work as expected, please open a issue.

Project details


Release history Release notifications | RSS feed

This version

2.0.0

Download files

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

Source Distribution

glyphsLib-2.0.0.zip (317.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

glyphsLib-2.0.0-py2.py3-none-any.whl (271.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file glyphsLib-2.0.0.zip.

File metadata

  • Download URL: glyphsLib-2.0.0.zip
  • Upload date:
  • Size: 317.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for glyphsLib-2.0.0.zip
Algorithm Hash digest
SHA256 9d96f9a94baf83c2babfedf043f5ad53b038d08d7e5f8f6ca2f1acad234f997d
MD5 1b51bd8283bdbfedd58a96d7ad4c635c
BLAKE2b-256 87bd46e0ddb0ecfad11833cbf5bb7be37453c3c6c4f4fe4cb2d56f3cbd16e683

See more details on using hashes here.

File details

Details for the file glyphsLib-2.0.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for glyphsLib-2.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a8fe7df9b71a09a06e0d943bd4a79d861a848f87f6b813ef1067b7de52636eac
MD5 1dd0ece76b1b9f22772fdf9e0f15e25b
BLAKE2b-256 9afacd0b2196732cffa7f1bab9298e52b96402e5208cf305363e8d5f3cfc2986

See more details on using hashes here.

Supported by

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