ftcli metrics

Vertical metrics tools.

ftcli metrics [OPTIONS] COMMAND [ARGS]...

subcommands

align

Aligns all fonts stored in INPUT_PATH folder to the same baseline.

To achieve this, the script finds the maximum ascender and the minimum descender values of the fonts stored in the INPUT_PATH folder and applies those values to all fonts.

This can produce undesired effects (an exaggerated line height) when one or more fonts contain swashes, for example. In such cases, it’s better to copy the vertical metrics from a template font to one or more destination fonts using the ‘ftcli metrics copy-metrics’ command.

See https://kltf.de/download/FontMetrics-kltf.pdf for more information.

ftcli metrics align [OPTIONS] INPUT_PATH

Options

--with-linegap

By default, SIL method (https://silnrsi.github.io/FDBP/en-US/Line_Metrics.html) is used. This means that, in OS/2 table, sTypoAscender and sTypoDescender values are set, respectively, equal to maximum real ascender and minimum real descender, and the sTypoLineGap is set to zero. Use ‘–with-linegap’ to set sTypoAscender value to the maximum ideal ascender (calculated from letters b, f, f, h, k, l and t) and the sTypoDescender value to the minimum ideal descender (calculated from letters g, j, p, q and y). The sTypoLineGap will be calculated as follows: (real ascender + abs(real descender)) - (ideal ascender + abs(ideal descender)).

-out, --output-dir <output_dir>

Specify the directory where output files are to be saved. If the directory doesn’t exist, will be created. If output_dir is not specified, files will be saved to the same folder.

--recalc-timestamp

Keep the original font ‘modified’ timestamp (head.modified) or set it to current time. By default, original timestamp is kept.

--no-overwrite

Overwrite existing files or save them to a new file (numbers are appended at the end of file name). By default, files are overwritten.

Arguments

INPUT_PATH

Required argument

copy-metrics

Copies vertical metrics from a source font to one or more destination fonts.

ftcli metrics copy-metrics [OPTIONS]

Options

-s, --source-file <source_file>

Required Source file. Vertical metrics from this font will be applied to all destination fonts.

-d, --destination <destination>

Required Destination file or directory.

-out, --output-dir <output_dir>

Specify the directory where output files are to be saved. If the directory doesn’t exist, will be created. If output_dir is not specified, files will be saved to the same folder.

--recalc-timestamp

Keep the original font ‘modified’ timestamp (head.modified) or set it to current time. By default, original timestamp is kept.

--no-overwrite

Overwrite existing files or save them to a new file (numbers are appended at the end of file name). By default, files are overwritten.

set-linegap

Modifies the line spacing metrics in one or more fonts.

This is a fork of font-line by Source Foundry: https://github.com/source-foundry/font-line

ftcli metrics set-linegap [OPTIONS] INPUT_PATH

Options

-p, --percent <percent>

Required Adjust font line spacing to % of UPM value.

-out, --output-dir <output_dir>

Specify the directory where output files are to be saved. If the directory doesn’t exist, will be created. If output_dir is not specified, files will be saved to the same folder.

--recalc-timestamp

Keep the original font ‘modified’ timestamp (head.modified) or set it to current time. By default, original timestamp is kept.

--no-overwrite

Overwrite existing files or save them to a new file (numbers are appended at the end of file name). By default, files are overwritten.

Arguments

INPUT_PATH

Required argument