ftcli otf

A set of tools to manipulate fonts with PostScript outlines.

ftcli otf [OPTIONS] COMMAND [ARGS]...

subcommands

autohint

Auto-hint OTF and PostScript flavored WOFF/WOFF2 fonts.

ftcli otf autohint [OPTIONS] INPUT_PATH

Options

--optimize, --no-optimize

Optimize the hinted font by specializing the charstrings and applying subroutines.

-rf, --reference-font <reference_font>

Reference font.

Font to be used as reference, when hinting multiple fonts compatibility.

-c, --allow-changes

Allow changes to the glyph outlines.

Paths are reordered to reduce hint substitution, and nearly straight curves are flattened.

-d, --decimal

Use decimal coordinates.

-nf, --no-flex

Suppress generation of flex commands.

-ns, --no-hint-sub

Suppress hint substitution.

-nz, --no-zones-stems

Allow the font to have no alignment zones nor stem widths.

-r, --recursive

If input_path is a directory, recursively find font files both in input directory and its subdirectories.

-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

check-outlines

Performs outline quality checks and overlaps removal with checkoutlinesufo.

ftcli otf check-outlines [OPTIONS] INPUT_PATH

Options

-q, --quiet-mode

Run in quiet mode.

-r, --recursive

If input_path is a directory, recursively find font files both in input directory and its subdirectories.

-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

dehint

Remove hints from CFF flavored (OTF, WOFF, WOFF2) fonts.

ftcli otf dehint [OPTIONS] INPUT_PATH

Options

--no-subr

Do not subroutinize dehinted fonts.

-d, --dehinter <dehinter>

Use tx (default) or fontTools to remove hints.

tx creates a temporary .cff file (tx -cff) removing hints (-n), preserving the glyph order (+d) and applying subroutines (+S). Then the .cff file is merged to the destination file using sfntedit, as explained here: https://github.com/adobe-type-tools/afdko/wiki/How-To#how-to-remove-hints-from-a-cff-based-otf. Finally, the temporary .cff file is deleted.

fontTools uses the subset.cff.remove_hints() method to remove hints, and the font is subroutinized with cffsubr (subroutinization can be deactivated passing the –no-subr parameter).

fontTools drops font-wide hinting values from the Private dict, while tx preserves them.

Default:

'tx'

Options:

tx | fonttools

-r, --recursive

If input_path is a directory, recursively find font files both in input directory and its subdirectories.

-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

desubr

Desubroutinize OpenType-PS fonts.

ftcli otf desubr [OPTIONS] INPUT_PATH

Options

-r, --recursive

If input_path is a directory, recursively find font files both in input directory and its subdirectories.

-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

fix-contours

Fix contours by correcting contours direction, removing overlaps and tiny paths.

ftcli otf fix-contours [OPTIONS] INPUT_PATH

Options

--min-area <min_area>

Minimum area for a tiny outline.

Default is 25 square units. Subpaths with a bounding box less than this will be reported and deleted.

--no-subr

Do not subroutinize fixed fonts.

--silent

Run in silent mode

-r, --recursive

If input_path is a directory, recursively find font files both in input directory and its subdirectories.

-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

fix-version

Aligns CFF topDict version string to the head.fontRevision value.

For example, if head.fontRevision value is 2.001, CFF topDict version value will be 2.1.

ftcli otf fix-version [OPTIONS] INPUT_PATH

Options

-r, --recursive

If input_path is a directory, recursively find font files both in input directory and its subdirectories.

-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

subr

Subroutinize OpenType-PS fonts.

ftcli otf subr [OPTIONS] INPUT_PATH

Options

-r, --recursive

If input_path is a directory, recursively find font files both in input directory and its subdirectories.

-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