Skip to main content

Python library for manipulating OpenType font features

Project description

fontFeatures library

If you're looking for the FEE language, it has been renamed to FEZ and moved to its own library (fez).

OpenType fonts are "programmed" using features, which are normally authored in Adobe's feature file format. This like source code to a computer program: it's a user-friendly, but computer-unfriendly, way to represent the features.

Inside a font, the features are compiled in an efficient internal format. This is like the binary of a computer program: computers can use it, but they can't do else anything with it, and people can't read it.

The purpose of this library is to provide a middle ground for representing features in a machine-manipulable format, kind of like the abstract syntax tree of a computer programmer. This is so that:

  • features can be represented in a structured human-readable and machine-readable way, analogous to the XML files of the Unified Font Object format.
  • features can be more directly authored by programs (such as font editors), rather than them having to output AFDKO feature file format.
  • features can be easily manipulated by programs - for example, features from two files merged together, or lookups moved between languages.

How is this different from fontTool's feaLib? I'm glad you asked. feaLib translates between the Adobe feature file format and a abstract syntax tree representing elements of the feature file - not representing the feature data. The AST is still "source equivalent". For example, when you code an aalt feature in feature file format, you might include code like feature salt to include lookups from another feature. But what's actually meant by that is a set of lookups. fontFeatures allows you to manipulate meaning, not description.

Components

fontFeatures consists of the following components:

  • fontFeatures itself, which is an abstract representation of the different layout operations inside a font.
  • fontFeatures.feaLib (included as a mixin) which translates between Adobe feature syntax and fontFeatures representation.
  • fontFeatures.ttLib, which translates between OpenType binary fonts and fontFeatures representation. (Currently only OTF -> fontFeatures is partially implemented; there is no fontFeatures -> OTF compiler yet.)
  • fontFeatures.fontDameLib which translate FontDame text files into fontFeatures objects.

And the following utilities:

  • otf2fea: translates an OTF file into Adobe features syntax.
  • txt2fea: translates a FontDame txt file into Adobe features syntax.

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

fontFeatures-1.1.0.tar.gz (78.2 kB view details)

Uploaded Source

Built Distribution

fontFeatures-1.1.0-py3-none-any.whl (98.1 kB view details)

Uploaded Python 3

File details

Details for the file fontFeatures-1.1.0.tar.gz.

File metadata

  • Download URL: fontFeatures-1.1.0.tar.gz
  • Upload date:
  • Size: 78.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.7

File hashes

Hashes for fontFeatures-1.1.0.tar.gz
Algorithm Hash digest
SHA256 79bbfff7c8b529b57a8ad8572c24f365835ff7282e226f3b3fb32f4668faacdf
MD5 014efb99ece1ba46ca184409ba3829b5
BLAKE2b-256 e0f8cab77b7ce7077e7899a1d38144b52f721b3a188afff04d8233e9a9d3cfc3

See more details on using hashes here.

File details

Details for the file fontFeatures-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: fontFeatures-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 98.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.7

File hashes

Hashes for fontFeatures-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f9d60afaf18d9ec88824558fdf4b2907f377374574c4ab43eab3cff6d888911d
MD5 4f4d47f2d3a6cc632ab0fac2f531af93
BLAKE2b-256 c2391bc0f57d4c5660d752a8d3ca96f920188af3cdb650ad0c2412884ce18716

See more details on using hashes here.

Supported by

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