Commit Graph

12 Commits

Author SHA1 Message Date
e151e51e81 Update the README 2026-03-15 16:29:44 +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
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
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
2025-08-22 11:16:03 +02:00
7bc0539bc4 Add warning to README 2025-08-22 02:46:34 +02:00
1e7b433827 Add --remove-prefix 2025-08-21 23:21:52 +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
28673c3d49 Update script, README 2025-08-21 13:23:38 +02:00
c58a0eec66 Add README, .gitignore 2025-08-21 12:49:10 +02:00