Skip to content

Commit 7b9162a

Browse files
added documentation to readme
1 parent 2ab3198 commit 7b9162a

File tree

1 file changed

+49
-1
lines changed

1 file changed

+49
-1
lines changed

README.md

+49-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,50 @@
11
# fontname.py
2-
Font renaming script (otf and ttf fonts)
2+
3+
## About
4+
5+
`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.
6+
7+
## Dependency
8+
- [fonttools](https://github.com/fonttools/fonttools) Python library
9+
10+
Install with:
11+
12+
```
13+
pip install fonttools
14+
```
15+
16+
## Usage
17+
18+
The script usage is as follows:
19+
20+
```
21+
$ python fontname.py [NEW FONT FAMILY NAME] [FONT PATH 1] <FONT PATH ...>
22+
```
23+
24+
It updates the OpenType name tables 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.
25+
26+
### Examples
27+
28+
```
29+
$ python fontname.py "Hack DEV" Hack-Regular.ttf
30+
```
31+
32+
![fscw-hack](https://user-images.githubusercontent.com/4249591/32151555-2a456982-bcf4-11e7-8ec8-57f8dbbd40a4.png)
33+
34+
35+
```
36+
$ python fontname.py "Source Code Pro DEV" SourceCodePro-Regular.otf
37+
```
38+
39+
![fscw-scp](https://user-images.githubusercontent.com/4249591/32151559-2e58a688-bcf4-11e7-9d39-7c8accdc41a6.png)
40+
41+
42+
```
43+
$ python fontname.py "DejaVu Sans Mono DEV" DejaVuSansMono-Bold.ttf
44+
```
45+
46+
![fscw-djv](https://user-images.githubusercontent.com/4249591/32151564-3414a644-bcf4-11e7-93c3-93bc2bbaebdb.png)
47+
48+
These should all be detected as "different" fonts so that you can install them side-by-side with the pre-modified versions.
49+
50+
**Note**: this re-writes the name tables in the fonts passed as arguments on the command line so make copies first if you intend to maintain the fonts with the former naming scheme.

0 commit comments

Comments
 (0)