Giter VIP home page Giter VIP logo

fontname.py's Introduction

fontname.py

About

fontname.py is a .ttf and .otf font renaming script that is developed in Python. It supports font renaming with the Python 3.6+ interpreter.

Dependency

  • fonttools Python library (requires v4.0.0+)

Install with:

pip3 install fonttools

Usage

The script usage is as follows:

$ python3 fontname.py [NEW FONT FAMILY NAME] [FONT PATH 1] <FONT PATH ...>

This script updates the OpenType name table records nameID 1, 4, 6, and 16 with appropriately formatted font names using the font style definition in the font and the new font family name defined by the user as the first command line argument. You can include any number of subsequent font paths on the command line. The style will be detected in the OpenType tables of the fonts filepath arguments and will be used to create new name strings in the OpenType tables.

Note: this re-writes the name tables in the fonts passed as arguments on the command line (i.e. writes files in place) so make copies first if you intend to maintain the fonts with the former naming for any reason (though you can simply re-write with the previous name if you forget...).

Examples

$ python3 fontname.py "Hack DEV" Hack-Regular.ttf

fscw-hack

$ python3 fontname.py "Source Code Pro DEV" SourceCodePro-Regular.otf

fscw-scp

$ python3 fontname.py "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.

License

MIT License

fontname.py's People

Contributors

chrissimpkins avatar

Watchers

James Cloos 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.