ftcli name

A set of tools to write, delete and modify NameRecords in the name table.

ftcli name [OPTIONS] COMMAND [ARGS]...

subcommands

append

Appends a prefix and/or a suffix to the specified NameRecords. If no platformID is specified, the prefix/suffix will be added to all NameRecords with the specified nameID. If no language string is specified, the prefix/suffix will be added to all NameRecords with the specified nameID and platformID.

ftcli name append [OPTIONS] INPUT_PATH

Options

-n, --name-id <name_ids>

Required nameID of the NameRecords where to append the prefix/suffix.

This option can be repeated to prepend/append the string to multiple NameRecords (e.g.: -x 3 -x 5 -x 6).

-p, --platform-id <platform_id>

Use this option to add the prefix/suffix only to the NameRecords matching the provided platformID (0: Unicode, 1: Macintosh, 3: Windows).

Options:

0 | 1 | 3

-l, --language-string <language_string>

Use this option to append the prefix/suffix only to the NameRecords matching the provided language string.

See epilog for a list of valid language strings.

--prefix <prefix>

The string to be prepended to the NameRecords

--suffix <suffix>

The suffix to append to the NameRecords

-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

MACINTOSH LANGUAGES: en, fr, de, it, nl, sv, es, da, pt, no, he, ja, ar, fi, el, is, mt, tr, hr, zh-Hant, ur, hi, th, ko, lt, pl, hu, es, lv, se, fo, fa, ru, zh, nl-BE, ga, sq, ro, cz, sk, sl, yi, sr, mk, bg, uk, be, uz, kk, az-Cyrl, az-Arab, hy, ka, mo, ky, tg, tk, mn-CN, mn, ps, ks, ku, sd, bo, ne, sa, mr, bn, as, gu, pa, or, ml, kn, ta, te, si, my, km, lo, vi, id, tl, ms, ms-Arab, am, ti, om, so, sw, rw, rn, ny, mg, eo, cy, eu, ca, la, qu, gn, ay, tt, ug, dz, jv, su, gl, af, br, iu, gd, gv, ga, to, el-polyton, kl, az, nn

WINDOWS LANGUAGES: faf, sq, gsw, am, ar-DZ, ar-BH, ar, ar-IQ, ar-JO, ar-KW, ar-LB, ar-LY, ary, ar-OM, ar-QA, ar-SA, ar-SY, aeb, ar-AE, ar-YE, hy, as, az-Cyrl, az, ba, eu, be, bn, bn-IN, bs-Cyrl, bs, br, bg, ca, zh-HK, zh-MO, zh, zh-SG, zh-TW, co, hr, hr-BA, cs, da, prs, dv, nl-BE, nl, en-AU, en-BZ, en-CA, en-029, en-IN, en-IE, en-JM, en-MY, en-NZ, en-PH, en-SG, en-ZA, en-TT, en-GB, en, en-ZW, et, fo, fil, fi, fr-BE, fr-CA, fr, fr-LU, fr-MC, fr-CH, fy, gl, ka, de-AT, de, de-LI, de-LU, de-CH, el, kl, gu, ha, he, hi, hu, is, ig, id, iu, iu-Latn, ga, xh, zu, it, it-CH, ja, kn, kk, km, quc, rw, sw, kok, ko, ky, lo, lv, lt, dsb, lb, mk, ms-BN, ms, ml, mt, mi, arn, mr, moh, mn, mn-CN, ne, nb, nn, oc, or, ps, pl, pt, pt-PT, pa, qu-BO, qu-EC, qu, ro, rm, ru, smn, smj-NO, smj, se-FI, se, se-SE, sms, sma-NO, sms, sa, sr-Cyrl-BA, sr, sr-Latn-BA, sr-Latn, nso, tn, si, sk, sl, es-AR, es-BO, es-CL, es-CO, es-CR, es-DO, es-EC, es-SV, es-GT, es-HN, es-MX, es-NI, es-PA, es-PY, es-PE, es-PR, es, es, es-US, es-UY, es-VE, sv-FI, sv, syr, tg, tzm, ta, tt, te, th, bo, tr, tk, ug, uk, hsb, ur, uz-Cyrl, uz, vi, cy, wo, sah, ii, yo

del-mac-names

Deletes all the Macintosh NameRecords (platformID=1) from the name table, except the ones with nameID 1, 2, 4, 5, and 6.

According to Apple (https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6name.html), “names with platformID 1 were required by earlier versions of macOS. Its use on modern platforms is discouraged. Use names with platformID 3 instead for maximum compatibility. Some legacy software, however, may still require names with platformID 1, platformSpecificID 0”.

ftcli name del-mac-names [OPTIONS] INPUT_PATH

Options

--del-all

Deletes also nameIDs 1, 2, 4, 5 and 6.

-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

del-names

Deletes the specified NameRecords from the name table. If no platformID is specified, all NameRecords with the specified nameID will be deleted. If no language string is specified, all NameRecords with the specified nameID and platformID will be deleted.

ftcli name del-names [OPTIONS] INPUT_PATH

Options

-n, --name-id <name_ids>

Required nameID of the NameRecord to delete.

This option can be repeated to delete multiple NameRecords at once (e.g.: -x 3 -x 5 -x 6).

-p, --platform-id <platform_id>

If platformID is specified, only NameRecords with matching platformID will be deleted.

Valid platformID values are: 0 (Unicode), 1 (Macintosh), 3 (Windows).

Options:

0 | 1 | 3

-l, --language-string <language_string>

Filter the NameRecords to delete by language string (for example: ‘it’, ‘de’, ‘nl’).

See epilog for a list of valid language strings.

-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

MACINTOSH LANGUAGES: en, fr, de, it, nl, sv, es, da, pt, no, he, ja, ar, fi, el, is, mt, tr, hr, zh-Hant, ur, hi, th, ko, lt, pl, hu, es, lv, se, fo, fa, ru, zh, nl-BE, ga, sq, ro, cz, sk, sl, yi, sr, mk, bg, uk, be, uz, kk, az-Cyrl, az-Arab, hy, ka, mo, ky, tg, tk, mn-CN, mn, ps, ks, ku, sd, bo, ne, sa, mr, bn, as, gu, pa, or, ml, kn, ta, te, si, my, km, lo, vi, id, tl, ms, ms-Arab, am, ti, om, so, sw, rw, rn, ny, mg, eo, cy, eu, ca, la, qu, gn, ay, tt, ug, dz, jv, su, gl, af, br, iu, gd, gv, ga, to, el-polyton, kl, az, nn

WINDOWS LANGUAGES: faf, sq, gsw, am, ar-DZ, ar-BH, ar, ar-IQ, ar-JO, ar-KW, ar-LB, ar-LY, ary, ar-OM, ar-QA, ar-SA, ar-SY, aeb, ar-AE, ar-YE, hy, as, az-Cyrl, az, ba, eu, be, bn, bn-IN, bs-Cyrl, bs, br, bg, ca, zh-HK, zh-MO, zh, zh-SG, zh-TW, co, hr, hr-BA, cs, da, prs, dv, nl-BE, nl, en-AU, en-BZ, en-CA, en-029, en-IN, en-IE, en-JM, en-MY, en-NZ, en-PH, en-SG, en-ZA, en-TT, en-GB, en, en-ZW, et, fo, fil, fi, fr-BE, fr-CA, fr, fr-LU, fr-MC, fr-CH, fy, gl, ka, de-AT, de, de-LI, de-LU, de-CH, el, kl, gu, ha, he, hi, hu, is, ig, id, iu, iu-Latn, ga, xh, zu, it, it-CH, ja, kn, kk, km, quc, rw, sw, kok, ko, ky, lo, lv, lt, dsb, lb, mk, ms-BN, ms, ml, mt, mi, arn, mr, moh, mn, mn-CN, ne, nb, nn, oc, or, ps, pl, pt, pt-PT, pa, qu-BO, qu-EC, qu, ro, rm, ru, smn, smj-NO, smj, se-FI, se, se-SE, sms, sma-NO, sms, sa, sr-Cyrl-BA, sr, sr-Latn-BA, sr-Latn, nso, tn, si, sk, sl, es-AR, es-BO, es-CL, es-CO, es-CR, es-DO, es-EC, es-SV, es-GT, es-HN, es-MX, es-NI, es-PA, es-PY, es-PE, es-PR, es, es, es-US, es-UY, es-VE, sv-FI, sv, syr, tg, tzm, ta, tt, te, th, bo, tr, tk, ug, uk, hsb, ur, uz-Cyrl, uz, vi, cy, wo, sah, ii, yo

find-replace

Finds and replaces a string in the specified NameRecords. If no nameID is specified, the string will be replaced in all NameRecords.

ftcli name find-replace [OPTIONS] INPUT_PATH

Options

-os, --old-string <old_string>

Required The string to be replaced

-ns, --new-string <new_string>

Required The string to replace the old string with

-n, --name-id <name_ids>

nameID of the NameRecords where to search and replace the string.

If nameID is not specified, the string will be replaced in all NameRecords.

This option can be repeated (e.g.: -x 3 -x 5 -x 6).

-x, --exclude-name-id <excluded_name_ids>

nameID of the NameRecords to skip.

This option can be repeated (e.g.: -x 3 -x 5 -x 6).

-p, --platform-id <platform_id>

platformID of the NameRecords where to perform find and replace (0: Unicode, 1: Macintosh, 3: Windows).

Options:

0 | 1 | 3

-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-name

Adds a NameRecord to the name table. If a NameRecord with the same nameID, platformID and languageID already exists, it will be overwritten.

ftcli name set-name [OPTIONS] INPUT_PATH

Options

-n, --name-id <name_id>

Required nameID of the NameRecord to add.

-s, --string <string>

Required The string to write in the NameRecord.

-p, --platform-id <platform_id>

platformID of the NameRecord to add (1: Macintosh, 3: Windows).

If platformID is not specified, both a platformID=1 and a platformID=3 NameRecords will be added.

Options:

1 | 3

-l, --language-string <language_string>

Write the NameRecord in a language different than English (e.g.: ‘it’, ‘nl’, ‘de’).

See epilog for a list of valid language strings.

Default:

en

-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

MACINTOSH LANGUAGES: en, fr, de, it, nl, sv, es, da, pt, no, he, ja, ar, fi, el, is, mt, tr, hr, zh-Hant, ur, hi, th, ko, lt, pl, hu, es, lv, se, fo, fa, ru, zh, nl-BE, ga, sq, ro, cz, sk, sl, yi, sr, mk, bg, uk, be, uz, kk, az-Cyrl, az-Arab, hy, ka, mo, ky, tg, tk, mn-CN, mn, ps, ks, ku, sd, bo, ne, sa, mr, bn, as, gu, pa, or, ml, kn, ta, te, si, my, km, lo, vi, id, tl, ms, ms-Arab, am, ti, om, so, sw, rw, rn, ny, mg, eo, cy, eu, ca, la, qu, gn, ay, tt, ug, dz, jv, su, gl, af, br, iu, gd, gv, ga, to, el-polyton, kl, az, nn

WINDOWS LANGUAGES: faf, sq, gsw, am, ar-DZ, ar-BH, ar, ar-IQ, ar-JO, ar-KW, ar-LB, ar-LY, ary, ar-OM, ar-QA, ar-SA, ar-SY, aeb, ar-AE, ar-YE, hy, as, az-Cyrl, az, ba, eu, be, bn, bn-IN, bs-Cyrl, bs, br, bg, ca, zh-HK, zh-MO, zh, zh-SG, zh-TW, co, hr, hr-BA, cs, da, prs, dv, nl-BE, nl, en-AU, en-BZ, en-CA, en-029, en-IN, en-IE, en-JM, en-MY, en-NZ, en-PH, en-SG, en-ZA, en-TT, en-GB, en, en-ZW, et, fo, fil, fi, fr-BE, fr-CA, fr, fr-LU, fr-MC, fr-CH, fy, gl, ka, de-AT, de, de-LI, de-LU, de-CH, el, kl, gu, ha, he, hi, hu, is, ig, id, iu, iu-Latn, ga, xh, zu, it, it-CH, ja, kn, kk, km, quc, rw, sw, kok, ko, ky, lo, lv, lt, dsb, lb, mk, ms-BN, ms, ml, mt, mi, arn, mr, moh, mn, mn-CN, ne, nb, nn, oc, or, ps, pl, pt, pt-PT, pa, qu-BO, qu-EC, qu, ro, rm, ru, smn, smj-NO, smj, se-FI, se, se-SE, sms, sma-NO, sms, sa, sr-Cyrl-BA, sr, sr-Latn-BA, sr-Latn, nso, tn, si, sk, sl, es-AR, es-BO, es-CL, es-CO, es-CR, es-DO, es-EC, es-SV, es-GT, es-HN, es-MX, es-NI, es-PA, es-PY, es-PE, es-PR, es, es, es-US, es-UY, es-VE, sv-FI, sv, syr, tg, tzm, ta, tt, te, th, bo, tr, tk, ug, uk, hsb, ur, uz-Cyrl, uz, vi, cy, wo, sah, ii, yo