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`
|
||||
- **[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
|
||||
|
||||
```
|
||||
@@ -74,4 +87,4 @@ Several metadata scripts are applied via FontForge:
|
||||
|
||||
#### 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
|
||||
|
||||
# 3. macOS app bundle
|
||||
mac_path = "/Applications/FontForge.app/Contents/MacOS/FontForge"
|
||||
if os.path.isfile(mac_path):
|
||||
FONTFORGE_CMD = [mac_path]
|
||||
return FONTFORGE_CMD
|
||||
mac_paths = [
|
||||
"/Applications/FontForge.app/Contents/MacOS/FontForge",
|
||||
"/Applications/FontForge.app/Contents/Resources/opt/local/bin/fontforge",
|
||||
]
|
||||
for mac_path in mac_paths:
|
||||
if os.path.isfile(mac_path):
|
||||
FONTFORGE_CMD = [mac_path]
|
||||
return FONTFORGE_CMD
|
||||
|
||||
print(
|
||||
"ERROR: FontForge not found.\n"
|
||||
@@ -187,13 +191,13 @@ def main():
|
||||
print(f" FontForge: {' '.join(ff_cmd)}")
|
||||
|
||||
family = DEFAULT_FAMILY
|
||||
old_kern = True
|
||||
old_kern = False
|
||||
|
||||
if "--customize" in sys.argv:
|
||||
print()
|
||||
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 = old_kern_input not in ("n", "no")
|
||||
old_kern_input = input(" Export with old-style kerning? [y/N]: ").strip().lower()
|
||||
old_kern = old_kern_input in ("y", "yes")
|
||||
|
||||
print()
|
||||
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})")
|
||||
|
||||
cmd = [
|
||||
sys.executable, "-m", "fontTools", "varLib.instancer",
|
||||
sys.executable, "-m", "fontTools.varLib.instancer",
|
||||
vf_path,
|
||||
"-o", ttf_out,
|
||||
f"wght={wght}",
|
||||
f"opsz={opsz}",
|
||||
"-o", ttf_out,
|
||||
]
|
||||
result = subprocess.run(cmd, capture_output=True, text=True)
|
||||
if result.stdout:
|
||||
|
||||
Reference in New Issue
Block a user