ftcli font

Font level utilities.

Usage

ftcli font [OPTIONS] COMMAND [ARGS]...

correct-contours

Correct contours of the given fonts by removing overlaps, correcting the direction of the contours, and removing tiny paths.

Fixing procedure:

  • Remove overlaps in the contours of the glyphs.

  • Correct the direction of the contours.

  • Remove tiny paths.

Usage

ftcli font correct-contours [OPTIONS] INPUT_PATH

Options

-ma, --min-area <min_area>

All subpaths with a bounding box less than this value will be removed. Default is 25 square units (same as afdko.checkoutlinesufo). Set to 0 to disable this feature.

--keep-hinting

Keep hinting for unmodified glyphs, default is to drop hinting

--ignore-errors

Ignore errors while correcting contours, thus keeping the tricky glyphs unchanged.

--keep-unused-subroutines

Keep unused subroutines in CFF table after removing overlaps, default is to remove them if any glyphs are modified.

-r, --recursive

Recursively find font files both in input directory and its subdirectories.

Only applicable if INPUT_PATH is a directory.

-out, --output-dir <output_dir>

The directory where output files are to be saved.

If not specified, files will be saved to the same folder.

If the output directory doesn’t exist, it will be created, as well as any missing parent directories.

-no-ow, --no-overwrite

Do not overwrite existing files on save.

If a file with the same name as the output file already exists, the command will suffix the filename with a number (#1, #2, etc.).

By default, existing files are overwritten.

-no-rbb, --no-recalc-bboxes

Do not recalculate the font’s bounding boxes on save.

By default, glyf, CFF ``, ``head bounding box values and hhea/vhea min/max values are recalculated on save. Also, the glyphs are compiled on importing, which saves memory consumption and time.

-no-rtb, --no-reorder-tables

Do not reorder the font’s tables on save.

By default, tables are sorted by tag on save (recommended by the OpenType specification).

-rts, --recalc-timestamp

Set the modified timestamp in the head table on save.

By default, the original modified timestamp is kept.

Arguments

INPUT_PATH

Required argument

del-table

Delete a table from the font file.

Usage

ftcli font del-table [OPTIONS] INPUT_PATH

Options

-t, --table-tag <table_tag>

Required The table tag to delete.

-r, --recursive

Recursively find font files both in input directory and its subdirectories.

Only applicable if INPUT_PATH is a directory.

-out, --output-dir <output_dir>

The directory where output files are to be saved.

If not specified, files will be saved to the same folder.

If the output directory doesn’t exist, it will be created, as well as any missing parent directories.

-no-ow, --no-overwrite

Do not overwrite existing files on save.

If a file with the same name as the output file already exists, the command will suffix the filename with a number (#1, #2, etc.).

By default, existing files are overwritten.

-no-rbb, --no-recalc-bboxes

Do not recalculate the font’s bounding boxes on save.

By default, glyf, CFF ``, ``head bounding box values and hhea/vhea min/max values are recalculated on save. Also, the glyphs are compiled on importing, which saves memory consumption and time.

-no-rtb, --no-reorder-tables

Do not reorder the font’s tables on save.

By default, tables are sorted by tag on save (recommended by the OpenType specification).

-rts, --recalc-timestamp

Set the modified timestamp in the head table on save.

By default, the original modified timestamp is kept.

Arguments

INPUT_PATH

Required argument

rebuild

Rebuild the font by saving it as XML to a temporary stream and then loading it back.

Usage

ftcli font rebuild [OPTIONS] INPUT_PATH

Options

-r, --recursive

Recursively find font files both in input directory and its subdirectories.

Only applicable if INPUT_PATH is a directory.

-out, --output-dir <output_dir>

The directory where output files are to be saved.

If not specified, files will be saved to the same folder.

If the output directory doesn’t exist, it will be created, as well as any missing parent directories.

-no-ow, --no-overwrite

Do not overwrite existing files on save.

If a file with the same name as the output file already exists, the command will suffix the filename with a number (#1, #2, etc.).

By default, existing files are overwritten.

-no-rbb, --no-recalc-bboxes

Do not recalculate the font’s bounding boxes on save.

By default, glyf, CFF ``, ``head bounding box values and hhea/vhea min/max values are recalculated on save. Also, the glyphs are compiled on importing, which saves memory consumption and time.

-no-rtb, --no-reorder-tables

Do not reorder the font’s tables on save.

By default, tables are sorted by tag on save (recommended by the OpenType specification).

-rts, --recalc-timestamp

Set the modified timestamp in the head table on save.

By default, the original modified timestamp is kept.

Arguments

INPUT_PATH

Required argument

remove-glyphs

Remove glyphs from a font file.

Usage

ftcli font remove-glyphs [OPTIONS] INPUT_PATH

Options

-gn, --glyph-name <glyph_names_to_remove>

The names of the glyphs to remove.

-gid, --glyph-id <glyph_ids_to_remove>

The glyph IDs to remove.

-r, --recursive

Recursively find font files both in input directory and its subdirectories.

Only applicable if INPUT_PATH is a directory.

-out, --output-dir <output_dir>

The directory where output files are to be saved.

If not specified, files will be saved to the same folder.

If the output directory doesn’t exist, it will be created, as well as any missing parent directories.

-no-ow, --no-overwrite

Do not overwrite existing files on save.

If a file with the same name as the output file already exists, the command will suffix the filename with a number (#1, #2, etc.).

By default, existing files are overwritten.

-no-rbb, --no-recalc-bboxes

Do not recalculate the font’s bounding boxes on save.

By default, glyf, CFF ``, ``head bounding box values and hhea/vhea min/max values are recalculated on save. Also, the glyphs are compiled on importing, which saves memory consumption and time.

-no-rtb, --no-reorder-tables

Do not reorder the font’s tables on save.

By default, tables are sorted by tag on save (recommended by the OpenType specification).

-rts, --recalc-timestamp

Set the modified timestamp in the head table on save.

By default, the original modified timestamp is kept.

Arguments

INPUT_PATH

Required argument

rename-glyph

Rename a glyph in a font file.

Usage

ftcli font rename-glyph [OPTIONS] INPUT_PATH

Options

-old, --old-name <old_name>

Required The old name of the glyph.

-new, --new-name <new_name>

Required The new name of the glyph.

-r, --recursive

Recursively find font files both in input directory and its subdirectories.

Only applicable if INPUT_PATH is a directory.

-out, --output-dir <output_dir>

The directory where output files are to be saved.

If not specified, files will be saved to the same folder.

If the output directory doesn’t exist, it will be created, as well as any missing parent directories.

-no-ow, --no-overwrite

Do not overwrite existing files on save.

If a file with the same name as the output file already exists, the command will suffix the filename with a number (#1, #2, etc.).

By default, existing files are overwritten.

-no-rbb, --no-recalc-bboxes

Do not recalculate the font’s bounding boxes on save.

By default, glyf, CFF ``, ``head bounding box values and hhea/vhea min/max values are recalculated on save. Also, the glyphs are compiled on importing, which saves memory consumption and time.

-no-rtb, --no-reorder-tables

Do not reorder the font’s tables on save.

By default, tables are sorted by tag on save (recommended by the OpenType specification).

-rts, --recalc-timestamp

Set the modified timestamp in the head table on save.

By default, the original modified timestamp is kept.

Arguments

INPUT_PATH

Required argument

rename-glyphs

Rename glyphs in a font file based on the glyph order of another font file.

Usage

ftcli font rename-glyphs [OPTIONS] INPUT_PATH

Options

-s, --source-file <source_file>

Required The source font file to get the glyph order from.

-r, --recursive

Recursively find font files both in input directory and its subdirectories.

Only applicable if INPUT_PATH is a directory.

-out, --output-dir <output_dir>

The directory where output files are to be saved.

If not specified, files will be saved to the same folder.

If the output directory doesn’t exist, it will be created, as well as any missing parent directories.

-no-ow, --no-overwrite

Do not overwrite existing files on save.

If a file with the same name as the output file already exists, the command will suffix the filename with a number (#1, #2, etc.).

By default, existing files are overwritten.

-no-rbb, --no-recalc-bboxes

Do not recalculate the font’s bounding boxes on save.

By default, glyf, CFF ``, ``head bounding box values and hhea/vhea min/max values are recalculated on save. Also, the glyphs are compiled on importing, which saves memory consumption and time.

-no-rtb, --no-reorder-tables

Do not reorder the font’s tables on save.

By default, tables are sorted by tag on save (recommended by the OpenType specification).

-rts, --recalc-timestamp

Set the modified timestamp in the head table on save.

By default, the original modified timestamp is kept.

Arguments

INPUT_PATH

Required argument

set-production-names

Set the production names of glyphs in a font file.

Usage

ftcli font set-production-names [OPTIONS] INPUT_PATH

Options

-r, --recursive

Recursively find font files both in input directory and its subdirectories.

Only applicable if INPUT_PATH is a directory.

-out, --output-dir <output_dir>

The directory where output files are to be saved.

If not specified, files will be saved to the same folder.

If the output directory doesn’t exist, it will be created, as well as any missing parent directories.

-no-ow, --no-overwrite

Do not overwrite existing files on save.

If a file with the same name as the output file already exists, the command will suffix the filename with a number (#1, #2, etc.).

By default, existing files are overwritten.

-no-rbb, --no-recalc-bboxes

Do not recalculate the font’s bounding boxes on save.

By default, glyf, CFF ``, ``head bounding box values and hhea/vhea min/max values are recalculated on save. Also, the glyphs are compiled on importing, which saves memory consumption and time.

-no-rtb, --no-reorder-tables

Do not reorder the font’s tables on save.

By default, tables are sorted by tag on save (recommended by the OpenType specification).

-rts, --recalc-timestamp

Set the modified timestamp in the head table on save.

By default, the original modified timestamp is kept.

Arguments

INPUT_PATH

Required argument

sort-glyphs

Sort the glyphs in a font file.

Usage

ftcli font sort-glyphs [OPTIONS] INPUT_PATH

Options

-by, --sort-by <sort_by>

The method to sort the glyphs.

* unicode: Sort the glyphs based on their Unicode values.
* alphabetical: Sort the glyphs alphabetically.
* cannedDesign: Sort glyphs into a design process friendly order.
Default:

'unicode'

Options:

unicode | alphabetical | cannedDesign

-r, --recursive

Recursively find font files both in input directory and its subdirectories.

Only applicable if INPUT_PATH is a directory.

-out, --output-dir <output_dir>

The directory where output files are to be saved.

If not specified, files will be saved to the same folder.

If the output directory doesn’t exist, it will be created, as well as any missing parent directories.

-no-ow, --no-overwrite

Do not overwrite existing files on save.

If a file with the same name as the output file already exists, the command will suffix the filename with a number (#1, #2, etc.).

By default, existing files are overwritten.

-no-rbb, --no-recalc-bboxes

Do not recalculate the font’s bounding boxes on save.

By default, glyf, CFF ``, ``head bounding box values and hhea/vhea min/max values are recalculated on save. Also, the glyphs are compiled on importing, which saves memory consumption and time.

-no-rtb, --no-reorder-tables

Do not reorder the font’s tables on save.

By default, tables are sorted by tag on save (recommended by the OpenType specification).

-rts, --recalc-timestamp

Set the modified timestamp in the head table on save.

By default, the original modified timestamp is kept.

Arguments

INPUT_PATH

Required argument