### Set NameRecord and Reorder Tables Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/name.md This example shows how to set a NameRecord string and ensure that the font's tables are reordered by tag on save, adhering to OpenType specifications. This can improve font compatibility and organization. ```shell ftcli name set-name -s "My Font" -n 1 -rts -rbb -rtb "/path/to/font.woff" ``` -------------------------------- ### Install FoundryTools-CLI in Editable Mode Source: https://github.com/ftcli/foundrytools-cli/blob/main/README.md Clone the repository and install the package in editable mode for development. This allows you to modify the source code directly. It is recommended to use a virtual environment. ```bash # clone the repository: git clone https://github.com/ftCLI/foundrytools-cli.git cd foundrytools-cli # create new virtual environment named e.g. ftcli-venv, or whatever you prefer: python -m venv ftcli-venv # to activate the virtual environmtnet in macOS and Linux, do: . ftcli-venv/bin/activate # to activate the virtual environment in Windows, do: ftcli-venv\Scripts\activate.bat # install in 'editable' mode python -m pip install -e . ``` -------------------------------- ### Install FoundryTools-CLI with pip Source: https://github.com/ftcli/foundrytools-cli/blob/main/README.md Install the FoundryTools-CLI package using pip. Ensure you are using Python 3.10 or later. If you have multiple Python versions, use `python3` instead of `python`. ```bash python -m pip install foundrytools-cli ``` -------------------------------- ### Set NameRecord with Platform ID Filter Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/name.md This example demonstrates how to set a NameRecord string while filtering by platform ID. This is useful when you need to update a specific platform's entry (e.g., Macintosh or Windows) without affecting others. Ensure the platform ID is either 1 (Macintosh) or 3 (Windows). ```shell ftcli name set-name -s "My Font Name" -n 1 -p 1 "/path/to/font.ttf" ``` -------------------------------- ### Specify Output Directory Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/os2.md Use the `-out` or `--output-dir` option to specify a directory for saving output files. If the directory does not exist, it will be created. ```shell ftcli os2 fstype -out /path/to/output INPUT_PATH ``` -------------------------------- ### Specify Output Directory with ftcli post Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/post.md Use the -out or --output-dir option to specify the directory for saving output files. If the directory does not exist, it will be created. ```shell ftcli post -out INPUT_PATH ``` -------------------------------- ### Specify Output Directory Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/os2.md Specifies the directory where output files will be saved. If not provided, files are saved in the same folder as the input. Creates the directory if it does not exist. ```shell ftcli os2 fsselection --output-dir INPUT_PATH ``` -------------------------------- ### Control Overwriting with ftcli post Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/post.md Use -ow or --overwrite to allow overwriting existing files, or -no-ow or --no-overwrite to prevent overwriting and suffix filenames with numbers. ```shell ftcli post -ow INPUT_PATH ``` ```shell ftcli post -no-ow INPUT_PATH ``` -------------------------------- ### Overwrite Existing Files Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/os2.md By default, existing files are overwritten. Use `-ow` or `--overwrite` to explicitly enable overwriting. ```shell ftcli os2 fstype -ow INPUT_PATH ``` -------------------------------- ### Build PostScript Name Command Usage Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/name.md This is the basic usage of the `build-postscript-name` command. Specify the input font file path to generate the PostScript Name. ```shell ftcli name build-postscript-name [OPTIONS] INPUT_PATH ``` -------------------------------- ### ftcli print Usage Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/print.md Shows the general usage of the ftcli print command and its available subcommands. ```shell ftcli print [OPTIONS] COMMAND [ARGS]... ``` -------------------------------- ### ftcli post Command Usage Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/post.md This shows the basic usage of the ftcli post command. Specify the input font file path as an argument. ```shell ftcli post [OPTIONS] INPUT_PATH ``` -------------------------------- ### ftcli print instances Usage Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/print.md Prints a table detailing the instances of a variable font. Requires the path to the font file. ```shell ftcli print instances [OPTIONS] INPUT_PATH ``` -------------------------------- ### Basic Usage of find-replace Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/name.md This is the basic command structure for finding and replacing text in NameRecords. Specify the input font file path. ```shell ftcli name find-replace [OPTIONS] INPUT_PATH ``` -------------------------------- ### Set Underline Thickness with ftcli post Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/post.md Use the --ul-thickness option to set the underlineThickness value in the 'post' table. ```shell ftcli post --ul-thickness INPUT_PATH ``` -------------------------------- ### Font Rebuild with Output Directory Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/font.md Specify an output directory for rebuilt font files using the `-out` or `--output-dir` option. If the directory does not exist, it will be created. ```shell ftcli font rebuild -out OUTPUT_DIR INPUT_PATH ``` -------------------------------- ### Set Fixed Pitch with ftcli post Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/post.md Use the --fixed-pitch option to set the isFixedPitch value to true, or --no-fixed-pitch to clear it. ```shell ftcli post --fixed-pitch INPUT_PATH ``` ```shell ftcli post --no-fixed-pitch INPUT_PATH ``` -------------------------------- ### Upgrade OS/2 Table Version Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/os2.md Use this command to upgrade the OS/2 table to a specified version. Provide the input font file path as an argument. ```shell ftcli os2 upgrade [OPTIONS] INPUT_PATH ``` -------------------------------- ### Recalculate OpenType-PS Hinting Zones Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/otf.md Use this command to recalculate the hinting zones of OpenType-PS fonts. It supports recursive processing of directories and options for output directory, overwriting, bounding box recalculation, table reordering, and timestamp updates. ```shell ftcli otf recalc-zones [OPTIONS] INPUT_PATH ``` -------------------------------- ### ftcli converter Usage Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/converter.md The base command for invoking font conversion utilities. ```shell ftcli converter [OPTIONS] COMMAND [ARGS]... ``` -------------------------------- ### Convert Variable Fonts to Static Fonts Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/converter.md Use this command to convert variable fonts to static fonts. Specify the input path to the font file or directory. ```shell ftcli converter var2static [OPTIONS] INPUT_PATH ``` -------------------------------- ### Build Full Font Name (NameID 4) Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/name.md Builds the NameID 4 (Full Font Name) for a given font file. Specify input path and optional platform ID. ```shell ftcli name build-full-name [OPTIONS] INPUT_PATH ``` -------------------------------- ### Specify Output Directory Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/otf.md Define the output directory for processed font files using the -out or --output-dir option. If not specified, files are saved in the same folder. The command will create the directory and any necessary parent directories if they do not exist. ```shell ftcli otf dehint -out "/path/to/output" INPUT_PATH ``` -------------------------------- ### Reorder Tables with ftcli post Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/post.md Use the -rtb or --reorder-tables option to sort the font's tables by tag on save, which is recommended by the OpenType specification. ```shell ftcli post -rtb INPUT_PATH ``` -------------------------------- ### Specifying Name IDs to Process Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/name.md Use the -n or --name-ids option to target specific name IDs for modification. Multiple IDs can be specified. ```shell ftcli name find-replace -n 1 -n 2 --old-string "Old Text" --new-string "New Text" font.ttf ``` -------------------------------- ### ftcli otf Usage Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/otf.md Basic usage of the ftcli otf command. This is the entry point for all OpenType-PS font operations. ```shell ftcli otf [OPTIONS] COMMAND [ARGS]... ``` -------------------------------- ### Font Rebuild with Overwrite Control Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/font.md Control overwriting of existing files. Use `-ow` or `--overwrite` (default behavior) to overwrite, or `-no-ow` or `--no-overwrite` to append a number to filenames if they already exist. ```shell ftcli font rebuild -no-ow INPUT_PATH ``` -------------------------------- ### Controlling File Overwriting Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/name.md Use -ow or --overwrite to allow overwriting existing files, or -no-ow or --no-overwrite to prevent overwriting. If overwriting is disabled and a file exists, a numbered suffix will be added to the filename. ```shell ftcli name find-replace -no-ow --old-string "Old Text" --new-string "New Text" font.ttf ``` -------------------------------- ### ftcli font Usage Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/font.md Shows the general usage of the ftcli font command with its options and arguments. ```shell ftcli font [OPTIONS] COMMAND [ARGS]... ``` -------------------------------- ### Convert WOFF/WOFF2 to SFNT Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/converter.md Basic usage of the wf2ft command to convert WOFF and WOFF2 font files to SFNT format. Specify the input path for the font files. ```shell ftcli converter wf2ft [OPTIONS] INPUT_PATH ``` -------------------------------- ### ftcli print font-info Usage Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/print.md Prints a table with the font's basic information, vertical metrics, font tables, and font features. Requires the path to the font file. ```shell ftcli print font-info [OPTIONS] INPUT_PATH ``` -------------------------------- ### ftcli cmap rebuild -rtb, --reorder-tables Option Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/cmap.md Activate table reordering by tag on save using -rtb or --reorder-tables, which is recommended by the OpenType specification. ```shell ftcli cmap rebuild -rtb INPUT_PATH ``` -------------------------------- ### Font Rebuild with Recursive Option Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/font.md Recursively find and rebuild font files in a directory and its subdirectories using the `-r` or `--recursive` option. ```shell ftcli font rebuild -r INPUT_DIR ``` -------------------------------- ### Recalculate OS/2 x-height Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/os2.md Use this command to recalculate the sxHeight value in the OS/2 table. Specify the input font file path as an argument. ```shell ftcli os2 recalc-x-height [OPTIONS] INPUT_PATH ``` -------------------------------- ### Strip Names Command Usage Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/name.md This is the basic usage of the `strip-names` command. Specify the input font file path to process. ```shell ftcli name strip-names [OPTIONS] INPUT_PATH ``` -------------------------------- ### Control Bounding Box Recalculation with ftcli post Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/post.md Use -rbb or --recalc-bboxes to enable recalculation of bounding boxes, or -no-rbb or --no-recalc-bboxes to disable it. By default, bounding boxes are recalculated. ```shell ftcli post -rbb INPUT_PATH ``` ```shell ftcli post -no-rbb INPUT_PATH ``` -------------------------------- ### ftcli font correct-contours Usage Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/font.md Demonstrates the usage of the correct-contours command for fixing font outlines. ```shell ftcli font correct-contours [OPTIONS] INPUT_PATH ``` -------------------------------- ### Build Unique ID (Default) Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/name.md Generates the unique ID using Font Revision; Vendor ID; PostScript Name. This is the default behavior when the --alternate flag is not used. ```shell ftcli name build-unique-id [OPTIONS] INPUT_PATH ``` -------------------------------- ### Control Overwriting Files Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/otf.md Manage the overwriting of existing files with the -ow, --overwrite, -no-ow, or --no-overwrite flags. By default, existing files are overwritten. If overwriting is disabled, files with the same name will be suffixed with a number. ```shell ftcli otf dehint -no-ow INPUT_PATH ``` -------------------------------- ### Autohint OpenType-PS Fonts Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/otf.md Autohints OpenType-PS fonts using the afdko.otfautohint tool. Specify input path and desired options for the hinting process. ```shell ftcli otf autohint [OPTIONS] INPUT_PATH ``` -------------------------------- ### Build Macintosh Font Names Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/name.md Use this command to build Macintosh-specific font names for a given font file or directory. Specify the input path to the font file or directory containing font files. ```shell ftcli name build-mac-names [OPTIONS] INPUT_PATH ``` -------------------------------- ### Prevent Overwriting Existing Files Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/os2.md Use `-no-ow` or `--no-overwrite` to prevent overwriting existing files. If a file with the same name exists, it will be suffixed with a number (e.g., `#1`, `#2`). ```shell ftcli os2 fstype -no-ow INPUT_PATH ``` -------------------------------- ### Recursive File Search with ftcli post Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/post.md Use the -r or --recursive flag to search for font files in subdirectories. This option is only applicable when INPUT_PATH is a directory. ```shell ftcli post -r INPUT_PATH ``` -------------------------------- ### Decompose Transformed Components with ftcli Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/fix.md Use this command to decompose glyphs with transformed components. This is particularly useful when building fonts with fontmake to avoid rasterization issues. ```shell ftcli fix transformed-components [OPTIONS] INPUT_PATH ``` -------------------------------- ### ftcli name command usage Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/name.md Basic usage of the ftcli name command. Specify OPTIONS, COMMAND, and ARGS to interact with the name table. ```shell ftcli name [OPTIONS] COMMAND [ARGS]... ``` -------------------------------- ### Recalculate Max Context Usage Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/os2.md Use this command to recalculate the `usMaxContext` value in the OS/2 table of a font file. Specify the input font file path as an argument. ```shell ftcli os2 recalc-max-context [OPTIONS] INPUT_PATH ``` -------------------------------- ### Build Unique ID (Alternate Mode) Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/name.md Generates the unique ID using Manufacturer Name: Family Name - Subfamily Name: Creation Year. This mode is activated by the --alternate flag. ```shell ftcli name build-unique-id --alternate [OPTIONS] INPUT_PATH ``` -------------------------------- ### ftcli cff Usage Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/cff.md The base command for interacting with the CFF table. ```shell ftcli cff [OPTIONS] COMMAND [ARGS]... ``` -------------------------------- ### Set NameRecord without Recalculating Bounding Boxes Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/name.md Use this command to set a NameRecord string without triggering a recalculation of the font's bounding boxes. This can save processing time if bounding box values are not critical to update. The original bounding box values will be preserved. ```shell ftcli name set-name -s "Version 1.0" -n 5 -no-rbb "/path/to/font.otf" ``` -------------------------------- ### Filtering by Platform ID Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/name.md Use the -p or --platform-id option to process only NameRecords associated with a specific platform ID. ```shell ftcli name find-replace -p 1 --old-string "Old Text" --new-string "New Text" font.ttf ``` -------------------------------- ### Run ftcli fix fs-selection Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/fix.md This command fixes the style flags in the OS/2.fsSelection and head.macStyle fields for font files. Specify the input path to the font file or directory. ```shell ftcli fix fs-selection [OPTIONS] INPUT_PATH ``` -------------------------------- ### Font Rebuild Command Usage Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/font.md Basic usage of the `font rebuild` command. Specify the input font file path. ```shell ftcli font rebuild [OPTIONS] INPUT_PATH ``` -------------------------------- ### ftcli os2 Usage Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/os2.md The base command for interacting with the OS/2 table. Specify options and commands to modify the table. ```shell ftcli os2 [OPTIONS] COMMAND [ARGS]... ``` -------------------------------- ### Recalculate OS/2 Cap Height Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/os2.md Use this command to recalculate the sCapHeight value in the OS/2 table. Specify the input font file path as an argument. ```shell ftcli os2 recalc-cap-height [OPTIONS] INPUT_PATH ``` -------------------------------- ### Convert TrueType to PostScript (ttf2otf) Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/converter.md Converts TrueType flavored fonts to PostScript flavored fonts. Supports various conversion modes, tolerance settings, and outline correction. ```shell ftcli converter ttf2otf [OPTIONS] INPUT_PATH ``` -------------------------------- ### ft2wf: Convert SFNT to WOFF/WOFF2 Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/converter.md Converts SFNT fonts to WOFF and/or WOFF2 formats. Specify the input font file path. ```shell ftcli converter ft2wf [OPTIONS] INPUT_PATH ``` -------------------------------- ### ftcli cmap rebuild -ow, --overwrite Option Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/cmap.md Control file overwriting behavior with -ow or --overwrite. By default, existing files are overwritten. Use --no-overwrite to prevent overwriting and suffix filenames with numbers. ```shell ftcli cmap rebuild -ow INPUT_PATH ``` ```shell ftcli cmap rebuild --no-overwrite INPUT_PATH ``` -------------------------------- ### ftcli cmap rebuild -out, --output-dir Option Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/cmap.md Specify the output directory for modified font files using -out or --output-dir. If not provided, files are saved in the same folder. Missing directories will be created. ```shell ftcli cmap rebuild -out INPUT_PATH ``` -------------------------------- ### Fix Integer PPEM for Hinted Fonts Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/fix.md Use this command to automatically set the `head.flags` bit 3 for hinted fonts. This ensures that PPEM values are forced to integers, which is a requirement for hinted fonts. ```shell ftcli fix integer-ppem-if-hinted [OPTIONS] INPUT_PATH ``` -------------------------------- ### ftcli utils sync-timestamps Usage Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/utils.md Synchronizes font file timestamps with their head table metadata. This command can process files recursively within a given input path. ```shell ftcli utils sync-timestamps [OPTIONS] INPUT_PATH ``` -------------------------------- ### Drop Hinting Data Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/otf.md Use the --drop-hinting-data option to remove specific hinting data like BlueValues, OtherBlues, and stem widths from the CFF Private dictionary. ```shell ftcli otf dehint --drop-hinting-data INPUT_PATH ``` -------------------------------- ### Recursive Font File Search Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/os2.md Recursively searches for font files in the input directory and its subdirectories. Only applicable when INPUT_PATH is a directory. ```shell ftcli os2 fsselection --recursive INPUT_DIR ``` -------------------------------- ### Recursive Font Processing Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/otf.md Enable recursive searching for font files within a directory and its subdirectories using the -r or --recursive option. This is only applicable when INPUT_PATH is a directory. ```shell ftcli otf dehint -r INPUT_PATH ``` -------------------------------- ### ftcli os2 fsselection Usage Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/os2.md Command to set flags in the fsSelection field of the OS/2 table. Requires an input font file path. ```shell ftcli os2 fsselection [OPTIONS] INPUT_PATH ``` -------------------------------- ### ftcli cmap rebuild -r, --recursive Option Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/cmap.md Use the -r or --recursive option to recursively find font files in the input directory and its subdirectories. This option is only applicable when INPUT_PATH is a directory. ```shell ftcli cmap rebuild -r INPUT_PATH ``` -------------------------------- ### ftcli cmap rebuild --remap-all Option Source: https://github.com/ftcli/foundrytools-cli/blob/main/docs/source/commands/cmap.md Use the --remap-all option to remap all glyphs, including those already present in the cmap table. ```shell ftcli cmap rebuild --remap-all INPUT_PATH ```