ftcli converter

Font conversion utilities.

Usage

ftcli converter [OPTIONS] COMMAND [ARGS]...

ft2wf

Convert SFNT fonts to WOFF and/or WOFF2 fonts.

Usage

ftcli converter ft2wf [OPTIONS] INPUT_PATH

Options

-f, --format <out_format>

By default, the script converts SFNT fonts to both woff and woff2 flavored web fonts. Use this option to convert only to woff or woff2 flavored web fonts.

Options:

woff | woff2

-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

otf2ttf

Convert PostScript flavored fonts to TrueType flavored fonts.

Usage

ftcli converter otf2ttf [OPTIONS] INPUT_PATH

Options

-t, --tolerance <tolerance>

Conversion tolerance (0.0-3.0, default 1.0). Low tolerance adds more points but keeps shapes. High tolerance adds few points but may change shape.

-upm, --target-upm <target_upm>

Set the target UPM value for the converted font.

Scaling is applied to the font after conversion to TrueType, to avoid scaling a PostScript font (which in some cases can lead to corrupted outlines).

-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

ttc2sfnt

Extract fonts from a TTCollection file.

Usage

ftcli converter ttc2sfnt [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

ttf2otf

Convert TrueType flavored fonts to PostScript flavored fonts.

Usage

ftcli converter ttf2otf [OPTIONS] INPUT_PATH

Options

-m, --mode <mode>

Conversion mode. By default, the script uses the qu2cu mode. Quadratic curves are converted to cubic curves using the Qu2CuPen. Use the tx mode to use the tx tool from AFDKO to generate the CFF table instead of the Qu2CuPen.

Default:

'qu2cu'

Options:

qu2cu | tx

-t, --tolerance <tolerance>

Conversion tolerance (0.0-3.0, default 1.0). Low tolerance adds more points but keeps shapes. High tolerance adds few points but may change shape.

This option is only used in the qu2cu mode.

-upm, --target-upm <target_upm>

Set the target UPM value for the converted font.

Scaling is applied to the TrueType font before conversion, to avoid scaling a PostScript font (which in some cases can lead to corrupted outlines).

-cc, --correct-contours, --no-cc, --no-correct-contours

Correct contours with pathops during conversion (removes overlaps and tiny contours, corrects direction).

Default:

True

-co, --check-outlines, --no-co, --no-check-outlines

Perform a further check with afdko.checkoutlinesufo after conversion.

Default:

False

-s, --subroutinize, --no-s, --no-subroutinize

Subroutinize the font with cffsubr after conversion.

Default:

True

-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

var2static

Convert variable fonts to static fonts.

Usage

ftcli converter var2static [OPTIONS] INPUT_PATH

Options

-ol, --overlap-mode <overlap>

The overlap mode to use when converting variable fonts to static fonts.

See https://fonttools.readthedocs.io/en/latest/varLib/instancer.html#fontTools.varLib.instancer.instantiateVariableFont

0: KEEP_AND_DONT_SET_FLAGS
1: KEEP_AND_SET_FLAGS
2: REMOVE
3: REMOVE_AND_IGNORE_ERRORS
Default:

'1'

Options:

0 | 1 | 2 | 3

-s, --select-instance

Select a single instance with custom axis values.

-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

wf2ft

Convert WOFF and WOFF2 fonts to SFNT fonts.

Usage

ftcli converter wf2ft [OPTIONS] INPUT_PATH

Options

-f, --format <in_format>

By default, the script converts both woff and woff2 flavored web fonts to SFNT fonts (TrueType or OpenType). Use this option to convert only woff or woff2 flavored web fonts.

Options:

woff | woff2

-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