googlefonts / ufomerge

ufomerge
Apache License 2.0
11 stars 3 forks source link

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:

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:

What to do about existing glyphs:

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:

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.