Skip to content

Commit

Permalink
v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissimpkins committed Nov 9, 2019
1 parent 1697249 commit bdd7464
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
## Changelog

### v1.0.0

- refactor fontname.py script to support Python 3.6+ interpreter only
- drop support for all versions of the Python 2 interpreter
- black source formatting
- add support for [name table record ID 16](https://docs.microsoft.com/en-us/typography/opentype/spec/name) edits

### v0.3.0

- bugfix: corrected PostScript nameID6 record suffix write. Previously spaces were not removed from this string value and they should be removed.
- bugfix: corrected PostScript name table record ID 6 suffix write. Previously spaces were not removed from this string value and they should be removed.
- minor update to control flow statement to make it more concise
- source code formatting improvements

Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,47 @@

## About

`fontname.py` is a `.ttf` and `.otf` font renaming script that is developed in Python. It supports font renaming with current versions of the Python 2 and Python 3 interpreters.
`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](https://github.com/fonttools/fonttools) Python library
- [fonttools](https://github.com/fonttools/fonttools) Python library (requires v4.0.0+)

Install with:

```
pip install fonttools
pip3 install fonttools
```

## Usage

The script usage is as follows:

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

This script updates the OpenType name table records nameID 1, 4, and 6 with appropriately formatted font names using the font variant already defined in the font file and the new font family name defined by the user as the first command line argument. You can include any number of subsequent font file paths on the command line. The variant type will be detected in the OpenType tables of the font(s) on the filepaths that are passed as arguments on the command line and will be used to create new name strings in the OpenType tables.
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

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

![fscw-hack](https://user-images.githubusercontent.com/4249591/32151555-2a456982-bcf4-11e7-8ec8-57f8dbbd40a4.png)


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

![fscw-scp](https://user-images.githubusercontent.com/4249591/32151559-2e58a688-bcf4-11e7-9d39-7c8accdc41a6.png)


```
$ python fontname.py "DejaVu Sans Mono DEV" DejaVuSansMono-Bold.ttf
$ python3 fontname.py "DejaVu Sans Mono DEV" DejaVuSansMono-Bold.ttf
```

![fscw-djv](https://user-images.githubusercontent.com/4249591/32151564-3414a644-bcf4-11e7-93c3-93bc2bbaebdb.png)
Expand Down

0 comments on commit bdd7464

Please sign in to comment.