https://github.com/framer/fixfont
Fix WOFF2 font metadata
https://github.com/framer/fixfont
Last synced: over 1 year ago
JSON representation
Fix WOFF2 font metadata
- Host: GitHub
- URL: https://github.com/framer/fixfont
- Owner: framer
- License: mit
- Created: 2024-04-17T12:06:46.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-22T14:34:29.000Z (about 2 years ago)
- Last Synced: 2025-01-09T11:28:12.070Z (over 1 year ago)
- Language: Python
- Size: 2.93 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fixfont.py
WOFF2 fonts intended for use as web fonts are sometimes distributed with
mangled metadata to “protect” them from being used as desktop fonts. Some tools
however, like Framer, rely on having the metadata available to show something
sensible in the UI.
This script can be used to fix the metadata of those fonts files.
## Usage
```
fixfont.py [-f "family name"] [-s "subfamily name"] [-o output.woff2]
```
- `font.woff2`: the path to the input font, has to be in woff2 format
- `-f family name`: the name of the font, make sure to use quotes if this contains spaces, e.g `-f "My Font"`. If not provided, it will try to figure out the name from the input file.
- `-s subfamily name`: also called the style or variant of the font, usually this is something like `-s Regular`, `-s Bold`, `-s Thin`, etc. If not provided, it will try to figure out the name from the input file.
- `-o output.woff2`: the path to where to write the result, if not specified, the script will put it next to the input file and will output where it has written the result.
## Requirements
The requirements are provided in `requirements.txt`. Install them with `pip install -r requirements.txt`.
Running in a Python virtual environment is recommended.