Skip to content

Conversation

@felipesanches
Copy link
Contributor

This is a followup to PR #585 and it must only be reviewed after that one is merged.

And when doing so, feel free to git rebase against main branch.

Variable fonts that include a vmtx (vertical metrics) table should also
include a VVAR table.

As noted by Behdad (at notofonts/noto-cjk#307),
inclusion of the VVAR table speeds up processing of vertical typesetting
significantly with only a minor file size increase, even in cases where
there is no variation in the vertical metrics (vmtx) across the
designspace. Fonttools automatically adds this table if the vmtx table
exists, and it isn't on the exclude list, but other build systems do
not at present.

(Closes fonttools#516)
Add unit tests for the missing-vvar warning in required_tables check:
- test_vvar_missing: variable font with vmtx but no VVAR triggers WARN
  and message contains "vmtx"
- test_vvar_present: variable font with vmtx AND VVAR has no warning

Add ShantellSans test font to resources/test/ for VVAR present case.
Remove equivalent Python tests in favor of Rust implementation.
- Add remove_table and add_table helpers to codetesting.rs
- Port remaining Python tests for required_tables check
- Tests cover TrueType, CFF, and CFF2 fonts
- Tests validate required tables, optional tables detection, and VVAR check
- Remove Python test file since Rust tests are now complete
- Note: maxp removal test skipped as it causes TestFont initialization to fail
…lpers

Replace raw byte manipulation in remove_table and add_table test helpers
with skrifa FontRef and write-fonts FontBuilder APIs. This reduces code
from ~110 lines each to ~15 lines while maintaining the same functionality.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant