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 fromfont-b
already exists infont-a
, nothing happens.--replace-existing
: If a glyph fromfont-b
already exists infont-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, becauseC
is not part of the target glyphset. The ligature stops working.--layout-closure
:C
is added to the target glyphset and merged intofont-a
so the ligature continues to work.--ignore-layout
: No layout rules are copied fromfont-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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ufomerge-1.8.1.tar.gz
.
File metadata
- Download URL: ufomerge-1.8.1.tar.gz
- Upload date:
- Size: 22.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e28c282c03dcfd0458f15e3532d2490ce3a206f5c4b8e8219c3af72c7879cc8a |
|
MD5 | f4a4521cdca5fb9dccf4dcca157f0f42 |
|
BLAKE2b-256 | 34b152d1178b1ad90253eff83723cdc2b15613d837dae647128fbfac00b6c570 |
File details
Details for the file ufomerge-1.8.1-py3-none-any.whl
.
File metadata
- Download URL: ufomerge-1.8.1-py3-none-any.whl
- Upload date:
- Size: 18.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e454aa7b4aad850289e6f5d72a9d083cca50add4604dc57895e1a2a1476be17 |
|
MD5 | f3cc856c844705c60ef598663ee0ebac |
|
BLAKE2b-256 | dce261fa61747f01a875856494c8c8e724f0114807262c2751bbb621a9307eba |