Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[subset] TrueType/CFF2 variable font #1558

Closed
7 of 8 tasks
blueshade7 opened this issue Jan 24, 2019 · 8 comments
Closed
7 of 8 tasks

[subset] TrueType/CFF2 variable font #1558

blueshade7 opened this issue Jan 24, 2019 · 8 comments
Assignees
Labels
subset hb-subset related bugs

Comments

@blueshade7
Copy link
Contributor

blueshade7 commented Jan 24, 2019

  • Add HVAR & VVAR subsetting for TT/CFF2
  • Add gvar struct for TT (sanitize, look-up, subsetting)
  • Calculate TT VF glyph widths (if HVAR/VVAR absent)
  • Calculate TT VF glyph extents from glyf & gvar (no hint support)
  • Add tests (subset: gvar, HVAR, VVAR)
  • Add tests (TT VF widths & extents)
  • ItemVariationStore subsetting in GPOS, GDEF
  • Add tests (subset: VF GPOS, GDEF)

Not to subset: MVAR, BASE, cvar
Not in scope: axes subsetting, instantiation

@blueshade7 blueshade7 self-assigned this Jan 24, 2019
@blueshade7
Copy link
Contributor Author

Removed task "Calculate TT/CFF2 VF glyph widths from HVAR/VVAR" because it is already in place

@ebraminio ebraminio added this to 2019 in HarfBuzz roadmap Jan 25, 2019
@blueshade7
Copy link
Contributor Author

This is my plan for HVAR & VVAR subsetting including VariationStore.

HVAR::subset to be called by _subset2; seems more convenient than _subset which requires to know size upfront (maybe rewrite CFF/CFF2 subsetter using _subset2 later?)

To subset inner indices for VariationStore, I am going to repurpose CFF::remap_t (one for each outer index), rewriting it based on hb_map_t & hb_set_t. Inner indices referenced by advMap/lsbMap/rsbMap are collected in hb_set_t, then old to new mapping is stored in hb_map_t.

I am not going to bother subsetting & remapping outer indices; for an unused outer index, its corresponding item variation data subtable is emptied. This wastes 6 bytes each but I don’t expect to see many outer indices in wild after all.

@blueshade7
Copy link
Contributor Author

Actually an empty item variation data subtable wastes 10 bytes counting 4-byte offset. It would be nice if an item variation data offset may be set to null for a missing table, but OTF spec doesn't seem to say so. Darn.

@blueshade7
Copy link
Contributor Author

Created branch var-subset for this task

@blueshade7
Copy link
Contributor Author

Decided to subset outer indices & variation data subtables after all, as fontTools appears to support it.
Pushed HVAR & VVAR subset to var-subset branch.

@blueshade7
Copy link
Contributor Author

blueshade7 commented Mar 1, 2019

Pushed advance width calculation using gvar & glyf

@blueshade7
Copy link
Contributor Author

Pushed glyph extents calculation using gvar & glyf
Added api test test-ot-metrics-tt-var, subset full font test with a TT variable font

@ebraminio ebraminio moved this from 2019 to In progress in HarfBuzz roadmap May 13, 2019
@khaledhosny khaledhosny added the subset hb-subset related bugs label Mar 10, 2020
@behdad
Copy link
Member

behdad commented Feb 12, 2021

Closing since there's nothing actionable here.

@behdad behdad closed this as completed Feb 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
subset hb-subset related bugs
Projects
No open projects
HarfBuzz roadmap
In progress
Development

No branches or pull requests

3 participants