ftcli os2

A set of tools to manipulate the ‘OS/2’ table.

ftcli os2 [OPTIONS] COMMAND [ARGS]...

subcommands

panose

Command line panose editor.

ftcli os2 panose [OPTIONS] INPUT_PATH

Options

--family-type <bFamilyType>

Sets ‘bFamilyType’ value

--serif-style <bSerifStyle>

Sets ‘bSerifStyle’ value

--weight <bWeight>

Sets ‘bWeight’ value

--proportion <bProportion>

Sets ‘bProportion’ value

--contrast <bContrast>

Sets ‘bContrast’ value

--stroke-variation <bStrokeVariation>

Sets ‘bStrokeVariation’ value

--arm-style <bArmStyle>

Sets ‘bArmStyle’ value

--letter-form <bLetterForm>

Sets ‘bLetterForm’ value

--midline <bMidline>

Sets ‘bMidline’ value

--x-height <bXHeight>

Sets ‘bXHeight’ value

-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

recalc-avg-width

Recalculates xAvgCharWidth value.

ftcli os2 recalc-avg-width [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

recalc-cap-height

Recalculates sCapHeight value.

ftcli os2 recalc-cap-height [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

recalc-max-context

Recalculates usMaxContext value.

ftcli os2 recalc-max-context [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

recalc-ranges

Generates a temporary Type 1 from the font file using tx, converts that to an OpenType font using makeotf, reads the Unicode ranges and codepage ranges from the temporary OpenType font file, and then writes those ranges to the original font’s OS/2 table.

ftcli os2 recalc-ranges [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

recalc-x-height

Recalculates sxHeight value.

ftcli os2 recalc-x-height [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

set-attrs

Command line OS/2 table editor.

ftcli os2 set-attrs [OPTIONS] INPUT_PATH

Options

-wght, --weight <usWeightClass>

Sets the usWeightClass value

-wdth, --width <usWidthClass>

Sets the usWidthClass value

-tasc, --typo-ascender <sTypoAscender>

Sets the sTypoAscender value

-tdsc, --typo-descender <sTypoDescender>

Sets the sTypoDescender value

-tlg, --typo-line-gap <sTypoLineGap>

Sets the sTypoLineGap value

-wasc, --win-ascent <usWinAscent>

Sets the usWinAscent value

-wdsc, --win-descent <usWinDescent>

Sets the usWinDescent value

-xhgt, --x-height <sxHeight>

Sets the sxHeight value

-chgt, --cap-height <sCapHeight>

Sets the sCapHeight value

-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

set-flags

Sets/clears the following flags in OS/2.fsSelection and OS/2.fsType fields:

fsSelection:

Bit 0: ITALIC
Bit 1: UNDERSCORE
Bit 2: NEGATIVE
Bit 3: OUTLINED
Bit 4: STRIKEOUT
Bit 5: BOLD
Bit 6: REGULAR
Bit 7: USE_TYPO_METRICS
Bit 8: WWS
Bit 9: OBLIQUE

fsType:

Bits 0-3: Usage permissions
Bit 8: No subsetting
Bit 9: Bitmap embedding only
ftcli os2 set-flags [OPTIONS] INPUT_PATH

Options

-it, --italic, -no-it, --no-italic

Sets or clears the ITALIC bits (fsSelection bit 0 and head table macStyle bit 1).

-us, --underscore, -no-us, --no-underscore

Sets or clears fsType bit 1 (UNDERSCORE).

-ng, --negative, -no-ng, --no-negative

Sets or clears fsType bit 2 (NEGATIVE).

-ol, --outlined, -no-ol, --no-outlined

Sets or clears fsType bit 3 (OUTLINED).

-st, --strikeout, -no-st, --no-strikeout

Sets or clears fsType bit 4 (STRIKEOUT).

-bd, --bold, -no-bd, --no-bold

Sets or clears the BOLD bits (OS/2.fsSelection bit 5 and head.macStyle bit 0).

-rg, --regular

Sets REGULAR (fsSelection bit 6) and clears BOLD (fsSelection bit 5, head.macStyle bit 0) and ITALIC (fsSelection bit 0, head.macStyle bit 1) bits. This is equivalent to –no-bold –no-italic.

-utm, --use-typo-metrics, -no-utm, --no-use-typo-metrics

Sets or clears the USE_TYPO_METRICS bit (fsSelection bit 7).

If set, it is strongly recommended that applications use OS/2.sTypoAscender - OS/2.sTypoDescender + OS/2.sTypoLineGap as the default line spacing for the font.

See: https://docs.microsoft.com/en-us/typography/opentype/spec/os2#fsselection

-wws, --wws-consistent, -no-wws, --no-wws-consistent

Sets or clears the WWS bit (fsSelection bit 8).

If the OS/2.fsSelection bit is set, the font has name table strings consistent with a weight/width/slope family without requiring use of name IDs 21 and 22.

See: https://docs.microsoft.com/en-us/typography/opentype/spec/os2#fsselection

Also: https://typedrawers.com/discussion/3857/fontlab-7-windows-reads-exported-font-name-differently

-obl, --oblique, -no-obl, --no-oblique

Sets or clears the OBLIQUE bit (fsSelection bit 9).

-el, --embed-level <embed_level>

Sets/clears fsType bits 0-3 (EMBEDDING_LEVEL).

Valid fonts must set at most one of bits 1, 2 or 3; bit 0 is permanently reserved and must be zero. Valid values for this sub-field are 0, 2, 4 or 8. The meaning of these values is as follows:

0: Installable embedding
2: Restricted License embedding
4: Preview & Print embedding
8: Editable embedding

See: https://docs.microsoft.com/en-us/typography/opentype/spec/os2#fstype

Options:

0 | 2 | 4 | 8

-ns, --no-subsetting, -as, --allow-subsetting

Sets or clears fsType bit 8 (NO_SUBSETTING).

When this bit is set, the font may not be subsetted prior to embedding. Other embedding restrictions specified in bits 0-3 and 9 also apply.

-beo, --bitmap-embedding-only, -no-beo, --no-bitmap-embedding-only

Sets or clears fsType bit 9 (BITMAP_EMBEDDING_ONLY).

When this bit is set, only bitmaps contained in the font may be embedded. No outline data may be embedded. If there are no bitmaps available in the font, then the font is considered unembeddable and the embedding services will fail. Other embedding restrictions specified in bits 0-3 and 8 also apply.

-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

set-version

Upgrades OS/2 table version.

ftcli os2 set-version [OPTIONS] INPUT_PATH

Options

-v <target_version>

Required Target version

-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