Skip to main content

Python script to merge Adobe feature files into a single variable feature file

Project description

feamerge

Merge Adobe feature files into a single variable feature file

feamerge is a tool designed to solve the challenge of compiling designspace files with varying OpenType features. It automates the preprocessing of UFO feature files—expanding kerning and positioning groups—before merging them into a valid variable font feature file.

🔄 New Workflow

Previously, this process required running three separate scripts manually. With version 0.1.1, these have been unified into a single command:

  1. Break Kerning Groups: Expands @group definitions into individual glyph-to-glyph pairs.

  2. Break Positioning Groups: Expands group references in mark, abvm, and blwm statements into single-glyph anchor rules.

  3. Intelligent Merge: Combines the expanded features from all masters in the designspace into variable font syntax (e.g., pos A A (wght=400:10 wght=900:20)).

🚀 Installation

The package now supports standard Python installation, which automatically sets up the feamerge command in your environment.

# Create and activate a virtual environment
python3 -m venv venv
source venv/bin/activate  # On Windows use `venv\Scripts\activate`

# Install the package and dependencies
pip install .

💻 Usage

Command Line (Recommended)

You no longer need to call individual Python files. Simply use the feamerge command:

feamerge path/to/YourFont.ufo MyFont.designspace variable_features.fea

Programmatic Usage

If you still wish to use the combiner logic directly in a script:

from feamerge.combine_features import VariableFeatureCombiner

combiner = VariableFeatureCombiner("path/to/font.designspace")
combiner.save_combined_features("output/variable_features.fea")

📜 Changelog

v0.1.3

Bug Fixes & Pipeline Enhancements:

  • Added ufoLib2 to packaging dependencies.
  • Corrected package license configuration file reference.
  • Fixed CLI to preprocess all masters and properly chain sequential expansion steps.
  • Implemented fallback to retrieve anchor coordinates from UFO glyph data for empty feature anchor definitions.
  • Renamed and restructured combiner module to combine_features.

v0.1.2

Package Restructuring: Moved all scripts into the feamerge/ package directory for proper bundling.

Unified CLI: Added a single feamerge entry point to run the entire preprocessing and merging sequence automatically.

Improved Metadata: Consolidated project configuration into pyproject.toml.

Version Bump: Updated version to 0.1.1.

v0.1.0

Initial release with separate scripts for kerning expansion and feature merging.

Key Features

  • Designspace Integration: Handles both absolute and relative paths for UFO source references.

  • Variable Font Syntax: Generates coordinate:value pairs for positioning rules.

  • Intelligent Merging: Deduplicates glyph classes and maintains OpenType features across masters.

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

feamerge-0.1.4.tar.gz (46.8 kB view details)

Uploaded Source

Built Distribution

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

feamerge-0.1.4-py3-none-any.whl (36.0 kB view details)

Uploaded Python 3

File details

Details for the file feamerge-0.1.4.tar.gz.

File metadata

  • Download URL: feamerge-0.1.4.tar.gz
  • Upload date:
  • Size: 46.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for feamerge-0.1.4.tar.gz
Algorithm Hash digest
SHA256 f757da772b733b1c56c86ffc29f75015e30636cf4d218217d19a22572904327d
MD5 9ae7bfb0d3acdbdb56f08f276b89ba2b
BLAKE2b-256 4c4d8c29e462878a8183808d900580a848dd206161f12fa57f56c330dde4ba58

See more details on using hashes here.

Provenance

The following attestation bundles were made for feamerge-0.1.4.tar.gz:

Publisher: pypi-publish.yaml on mitradranirban/feamerge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file feamerge-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: feamerge-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 36.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for feamerge-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d010059d01206a45e6410f1a9c3908439393b12f88f628d861772b44ed52b550
MD5 8bf6f7b98961d906ea3fb798ac5fc20f
BLAKE2b-256 c5bf1d62f370ac9b5da4bab9c6173f6406957d90cc643c89f16d6a0c0f5b8d52

See more details on using hashes here.

Provenance

The following attestation bundles were made for feamerge-0.1.4-py3-none-any.whl:

Publisher: pypi-publish.yaml on mitradranirban/feamerge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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