Skip to main content

Merge together two source fonts in UFO format

Project description

ufomerge

This command line utility and Python library merges together two UFO source format fonts into a single file. It can be used to include glyphs from one font into another font. It takes care of handling:

  • Glyph outlines and information
  • Kerning
  • lib entries
  • Including any needed components
  • "Subsetting" and merging layout rules

Usage

To merge the glyphs of font-b.ufo into font-a.ufo and save as merged.ufo:

$ ufomerge --output merged.ufo font-a.ufo font-b.ufo

To include particular glyphs:

$ ufomerge --output merged.ufo --glyphs alpha,beta,gamma font-a.ufo font-b.ufo

To include glyphs referencing particular Unicode codepoints:

$ ufomerge --output merged.ufo --unicodes 0x03B1,0x03B2,0x03B3 font-a.ufo font-b.ufo

Other useful command line parameters:

  • -G/--glyphs-file: Read the glyphs from a file containing one glyph per line.
  • -U/--codepoints-file: Read the Unicode codepoints from a file containing one codepoint per line.
  • -x/--exclude-glyphs: Stop the given glyphs from being included.
  • -v/--verbose: Be noisier.

What to do about existing glyphs:

  • --skip-existing (the default): If a glyph from font-b already exists in font-a, nothing happens.
  • --replace-existing: If a glyph from font-b already exists in font-a, the new glyph replaces the old one.

What do to about OpenType layout (features.fea). Suppose there is a rule sub A B by C;, and the incoming glyphs are A and B:

  • --subset-layout (the default): the rule is dropped, because C is not part of the target glyphset. The ligature stops working.
  • --layout-closure: C is added to the target glyphset and merged into font-a so the ligature continues to work.
  • --ignore-layout: No layout rules are copied from font-b at all.

Usage as a Python library

ufomerge provides two functions, merge_ufos and subset_ufo. Both take ufoLib2.Font objects, and are documented in their docstrings.

License

This software is licensed under the Apache license. See LICENSE.

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

ufomerge-1.8.0.tar.gz (22.4 kB view details)

Uploaded Source

Built Distribution

ufomerge-1.8.0-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

Details for the file ufomerge-1.8.0.tar.gz.

File metadata

  • Download URL: ufomerge-1.8.0.tar.gz
  • Upload date:
  • Size: 22.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.5

File hashes

Hashes for ufomerge-1.8.0.tar.gz
Algorithm Hash digest
SHA256 35d91f5cc2686e329585b7a0628f4904599ca9520d981e91c4f05a589522356c
MD5 203b3a41bd159a7e7d6fe7ff393dc6b2
BLAKE2b-256 3c91412682496edaeb1c745314c567002329e7cc339e79d417985fa99832e95d

See more details on using hashes here.

File details

Details for the file ufomerge-1.8.0-py3-none-any.whl.

File metadata

  • Download URL: ufomerge-1.8.0-py3-none-any.whl
  • Upload date:
  • Size: 18.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.5

File hashes

Hashes for ufomerge-1.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dbd270b80f7d78f39805f9c4b2781abc6dcbc54cc317bd6eddf0f7aa9bfd1911
MD5 78dcd62882019e73b548adeab85cf1cc
BLAKE2b-256 a8ff535adcf7996e778590f36c0549fbc9f426cffb9b85bd3bacfc68d0270848

See more details on using hashes here.

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