Disable old-style kern by default
This commit is contained in:
15
README.md
15
README.md
@@ -30,6 +30,19 @@ After running `build.py`, you should get:
|
|||||||
- **[fontTools](https://github.com/fonttools/fonttools)** — install with `pip install fonttools`
|
- **[fontTools](https://github.com/fonttools/fonttools)** — install with `pip install fonttools`
|
||||||
- **[FontForge](https://fontforge.org)** — the build script auto-detects FontForge from PATH, Flatpak, or the macOS app bundle
|
- **[FontForge](https://fontforge.org)** — the build script auto-detects FontForge from PATH, Flatpak, or the macOS app bundle
|
||||||
|
|
||||||
|
### Linux preparation
|
||||||
|
|
||||||
|
```
|
||||||
|
pip install fonttools
|
||||||
|
flatpak install flathub org.fontforge.FontForge
|
||||||
|
```
|
||||||
|
|
||||||
|
### macOS preparation
|
||||||
|
```
|
||||||
|
brew install fontforge
|
||||||
|
python3 -m pip install --user -U fonttools
|
||||||
|
```
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -74,4 +87,4 @@ Several metadata scripts are applied via FontForge:
|
|||||||
|
|
||||||
#### Step 4: Export
|
#### Step 4: Export
|
||||||
|
|
||||||
The final fonts are exported from FontForge as both SFD (FontForge source) and TTF with old-style kern tables for maximum compatibility with e-reader rendering engines.
|
The final fonts are exported from FontForge as both SFD (FontForge source) and TTF. The build supports optional old-style kern tables, but this is off by default because it has no effect on device tests.
|
||||||
|
|||||||
22
build.py
22
build.py
@@ -80,10 +80,14 @@ def find_fontforge():
|
|||||||
return FONTFORGE_CMD
|
return FONTFORGE_CMD
|
||||||
|
|
||||||
# 3. macOS app bundle
|
# 3. macOS app bundle
|
||||||
mac_path = "/Applications/FontForge.app/Contents/MacOS/FontForge"
|
mac_paths = [
|
||||||
if os.path.isfile(mac_path):
|
"/Applications/FontForge.app/Contents/MacOS/FontForge",
|
||||||
FONTFORGE_CMD = [mac_path]
|
"/Applications/FontForge.app/Contents/Resources/opt/local/bin/fontforge",
|
||||||
return FONTFORGE_CMD
|
]
|
||||||
|
for mac_path in mac_paths:
|
||||||
|
if os.path.isfile(mac_path):
|
||||||
|
FONTFORGE_CMD = [mac_path]
|
||||||
|
return FONTFORGE_CMD
|
||||||
|
|
||||||
print(
|
print(
|
||||||
"ERROR: FontForge not found.\n"
|
"ERROR: FontForge not found.\n"
|
||||||
@@ -187,13 +191,13 @@ def main():
|
|||||||
print(f" FontForge: {' '.join(ff_cmd)}")
|
print(f" FontForge: {' '.join(ff_cmd)}")
|
||||||
|
|
||||||
family = DEFAULT_FAMILY
|
family = DEFAULT_FAMILY
|
||||||
old_kern = True
|
old_kern = False
|
||||||
|
|
||||||
if "--customize" in sys.argv:
|
if "--customize" in sys.argv:
|
||||||
print()
|
print()
|
||||||
family = input(f" Font family name [{DEFAULT_FAMILY}]: ").strip() or DEFAULT_FAMILY
|
family = input(f" Font family name [{DEFAULT_FAMILY}]: ").strip() or DEFAULT_FAMILY
|
||||||
old_kern_input = input(" Export with old-style kerning? [Y/n]: ").strip().lower()
|
old_kern_input = input(" Export with old-style kerning? [y/N]: ").strip().lower()
|
||||||
old_kern = old_kern_input not in ("n", "no")
|
old_kern = old_kern_input in ("y", "yes")
|
||||||
|
|
||||||
print()
|
print()
|
||||||
print(f" Family: {family}")
|
print(f" Family: {family}")
|
||||||
@@ -224,11 +228,11 @@ def _build(tmp_dir, family=DEFAULT_FAMILY, old_kern=True):
|
|||||||
print(f" Instancing {name} (wght={wght}, opsz={opsz})")
|
print(f" Instancing {name} (wght={wght}, opsz={opsz})")
|
||||||
|
|
||||||
cmd = [
|
cmd = [
|
||||||
sys.executable, "-m", "fontTools", "varLib.instancer",
|
sys.executable, "-m", "fontTools.varLib.instancer",
|
||||||
vf_path,
|
vf_path,
|
||||||
"-o", ttf_out,
|
|
||||||
f"wght={wght}",
|
f"wght={wght}",
|
||||||
f"opsz={opsz}",
|
f"opsz={opsz}",
|
||||||
|
"-o", ttf_out,
|
||||||
]
|
]
|
||||||
result = subprocess.run(cmd, capture_output=True, text=True)
|
result = subprocess.run(cmd, capture_output=True, text=True)
|
||||||
if result.stdout:
|
if result.stdout:
|
||||||
|
|||||||
Reference in New Issue
Block a user