source/py/task/merge_font/README.md
Short utilities for merging and polishing TrueType/OpenType fonts used by the build tasks.
foundrytools.From Python build tasks:
uv run task.py merge
If config file not exists, it will be auto created. Example:
{
"family_name": "Maple Mono",
"output_dir": "./fonts",
"line_height": [850, -200],
"instances": {
"regular": [
"base_font.ttf",
{
"enable": true,
"path": "override_font.ttf",
"unicode_range": ["U+0030-0039", "U+2190-2199"],
"width_scale": 1.06,
"axes": {"wght": 400, "wdth": 100}
}
],
"bold": [
"/path/to/static/font.ttf",
{
"path": "/path/to/variable/font.ttf",
"axes": {"wght": 700, "wdth": 110},
"width_scale": 0.98,
"unicode_range": ["U+4E00-9FFF"]
},
{
"enable": false,
"path": "disabled_font.ttf"
}
]
}
}
1.02)[top, bottom] (e.g. [950, -200]){ "top": num, "bottom": num, "safe_top": num, "safe_bottom": num }Each instance style contains an array where:
Each override font supports:
["U+0030-0039"] for digits)All fonts for a given style are merged in a single FontForge process, using the first font as the base.