Commit Graph

31 Commits

Author SHA1 Message Date
cfc02c7a76 Validate that the script works correctly 2026-03-14 16:34:39 +01:00
6cd3e2b20b Refactor CLI flags into modal options and add presets
This is a big commit that fixes a variety of issues and prevents fonts
from growing far too large without any benefits. Previously, converted
fonts would use multiple subtables for the `kern` table, but sadly those
are usually not read by renderers, so we now don't save al kern pairs,
but we prioritize.

The full list of changes can be found below.

---

Replace individual boolean flags with modal --kern and --hint options:

- --hint {skip,additive,overwrite,strip}: controls hinting behavior,
  including new ttfautohint support (additive/overwrite modes)
- --kern {add-legacy-kern,legacy-kern-only,skip}: replaces the old
  --skip-kobo-kern and --remove-gpos flags
- --preset {nv,kf}: bundled configurations for common workflows

Add upfront dependency checking (`ttfautohint`, `font-line`) so missing
tools are caught before any processing begins.

Fix GPOS Extension lookup (type 9) support: kern pairs were silently
missed in fonts that wrap PairPos subtables in Extension lookups.

Rework legacy kern table writing to respect format 0 size constraints.
The subtable length field is uint16, limiting a single subtable to
10,920 pairs. Since most renderers (including Kobo) only read the first
subtable, we write exactly one and prioritize pairs by Unicode range.

=> Basic Latin > Latin-1 Supplement > Latin Extended > rest

This way, the most commonly encountered kerning pairs are preserved
when truncation is needed (and it usually is, for quality fonts).
2026-03-14 16:28:25 +01:00
04bded25cb Add different hinting options 2026-03-14 14:48:11 +01:00
56a0e16161 Add sponsorship links 2026-03-01 18:44:12 +01:00
d05db27a47 Various fixes
- TTF fonts are now required
- Fix incorrect Panose value being logged
- Do not allow conflicting settings
2026-03-01 16:29:47 +01:00
1ed3677d8e Add an option to remove TrueType hints
You can invoke it by adding `--remove-hints` as an argument.

This may improve the appearance of certain fonts on Kobo devices with
high resolution displays. Might make a difference for 300 DPI and up,
at 12 pt font sizes and above.

For the upcoming update to the  KF collection of fonts, this flag will
likely be used for all fonts or at the very least for a selection of
fonts that benefit from TrueType hints being absent.
2025-10-07 21:16:24 +02:00
da8b3631ea Allow omitting prefix v0.2 2025-10-07 15:45:49 +02:00
1dd9a6ab79 Adjust how kern pairs are copied 2025-10-07 15:38:45 +02:00
27c3aaf522 Updated README 2025-08-22 11:45:47 +02:00
507cb87fe1 Updated README, added LICENSE 2025-08-22 11:37:35 +02:00
eee6b0d739 Max 10k pairs per kern subtable (Fixes #1)
- Fixes script
- Adds kern diff script to compare fonts to helpers
- Moved ttfconv to helpers folder
- Updated README
v0.1
2025-08-22 11:16:03 +02:00
7bc0539bc4 Add warning to README 2025-08-22 02:46:34 +02:00
ab98334879 Remove WWS family names to avoid confusion 2025-08-21 23:50:45 +02:00
1e7b433827 Add --remove-prefix 2025-08-21 23:21:52 +02:00
69cf756099 Some more tweaks to fix edge cases 2025-08-21 22:22:06 +02:00
c9652c5f3c Final cleanup 2025-08-21 18:06:24 +02:00
8ec2feb37e Update overall structure and comments 2025-08-21 17:48:04 +02:00
d78ff480c1 Update subfamily name and preferred subfamily 2025-08-21 17:35:48 +02:00
6be361fd0e Add flag to remove GPOS table 2025-08-21 17:33:44 +02:00
c4ee594300 Fix issues with font name changes 2025-08-21 17:30:43 +02:00
c82ede412b Ensure OS/2 and PostScript weight normalization 2025-08-21 16:34:07 +02:00
0450a22c4a Add option to skip line adjustment 2025-08-21 16:18:03 +02:00
17c3846f0f Updated README 2025-08-21 16:09:10 +02:00
aeb4fd621b Update README, skip OTF 2025-08-21 16:04:00 +02:00
8b1d345b60 Remove backup 2025-08-21 14:26:10 +02:00
78b6132f9a Reworked with Claude 2025-08-21 14:17:06 +02:00
d5741b1020 Add the option to rename font 2025-08-21 13:46:44 +02:00
28673c3d49 Update script, README 2025-08-21 13:23:38 +02:00
c58a0eec66 Add README, .gitignore 2025-08-21 12:49:10 +02:00
40a78e6edd Improved validation, skip PANOSE if irrelevant 2025-08-21 12:41:19 +02:00
57f7c0de22 Initial commit 2025-08-21 12:39:12 +02:00