mirror of
https://github.com/nicoverbruggen/kobo-font-fix.git
synced 2025-11-05 09:30:08 +01:00
Add README, .gitignore
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
*.ttf
|
||||
*.otf
|
||||
43
README.md
Normal file
43
README.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# KoboFix Font Processor
|
||||
|
||||
## Overview
|
||||
|
||||
`kobofix.py` is a Python script designed to process TTF and OTF fonts for Kobo e-readers.
|
||||
|
||||
It generates a renamed font, fixes PANOSE information based on the filename, adjusts the baseline with the `font-line` utility, and adds a legacy `kern` table which allows the `kepub` engine for improved rendering of kerned pairs.
|
||||
|
||||
## Requirements
|
||||
|
||||
* **Python 3.8+**
|
||||
* **FontTools**
|
||||
|
||||
```bash
|
||||
pip3 install fonttools
|
||||
```
|
||||
* **font-line** utility
|
||||
|
||||
```bash
|
||||
pip3 install font-line
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
1. Open a terminal and navigate to the directory containing your font files.
|
||||
2. Run the script with a glob pattern to include all TTF/OTF files:
|
||||
|
||||
```bash
|
||||
python3 kobofix.py *.ttf
|
||||
```
|
||||
3. The script will:
|
||||
|
||||
* Validate filenames.
|
||||
* Process each font.
|
||||
* Apply kerning, rename, PANOSE adjustments, and baseline shift.
|
||||
* Save output as `KC_<original_filename>`.
|
||||
|
||||
Example:
|
||||
|
||||
```
|
||||
Original: Lora-BoldItalic.ttf
|
||||
Processed: KC_Lora-BoldItalic.ttf
|
||||
```
|
||||
Reference in New Issue
Block a user