Skip to content

matthewlindsey/fontrenamer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fontnamer

About

A Python utility that renames OpenType (.otf) and TrueType (.ttf) fonts using the fonttools library. This forked version of Chris Simpkins' fontname.py script has been packaged to allow simple installation as a global command line tool using pipx.

Font renaming script for OpenType tables in CFF (.otf) and OT TrueType (.ttf) fonts

Requirements

  • Python 3.6 or later

Dependencies

Usage

Once installed globally, fontnamer can be used as follows:

$ fontnamer family_name font_file...

The fontnamer command updates the name table records of .ttf and .otf files with appropriately formatted font names given the user-provided family_name and the style definition found within each font_file.

A few things to keep in mind:

  • You can provide multiple font_file arguments
  • Use quotes around family_name arguments that include spaces
  • This tool edits the font files in place, so make copies beforehand if you you would like to preserve the fonts with their former names. (You can always rewrite them with the previous name if you forget or change your mind.)

Details

To apply a new family name to a font file, fontnamer updates the following entries in its name table: Family Name (name ID 1). Full Name (name ID 4), PostScript name (id 6), Typographic Family (id 16). For OpenType fonts with Compact Font Format data, fonttools also updates the FontName, FullName, and FamilyName records in the CFF table.

Examples

$ fontnamer "Hack DEV" Hack-Regular.ttf

fscw-hack

$ fontnamer "Source Code Pro DEV" SourceCodePro-Regular.otf

fscw-scp

$ fontnamer "DejaVu Sans Mono DEV" DejaVuSansMono-Bold.ttf

fscw-djv

These should all be detected as "different" fonts so that you can install them side-by-side with the pre-modified versions.

Warnings

Many fonts have licences prohibiting modifications of any kind, including changes to font family names and other metadata. Please make sure to understand and respect the licenses of any fonts you wish to rename.

License

MIT License

About

Font renaming utility for OpenType (.otf) and TrueType (.ttf) fonts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages