Coder Social home page Coder Social logo

fontrenamer's Introduction

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

fontrenamer's People

Contributors

chrissimpkins avatar matthewlindsey avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.