Remove the "last gid" hack from encoder implementation
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 13
- Forks
- 8
- Avg merge
- 3h 57m
- Merged PRs (30d)
- 7
Description
Context: https://github.com/w3c/ift-encoder/blob/main/ift/encoder/encoder.cc#L219
When producing mixed encodings we need to ensure at each level of invalidating extension the loca/gvar/CFF/CFF2 offset arrays are large enough to accomadate any glyphs that may be added by any reachable glyph patches. This is currently handled using a crude hack of including the last gid of the original font in the initial subset (so that loca/gvar/CFF/CFF2 offset arrays are always at their maximum size).
As currently implemented this is sub optimal and will also conflict with producing a true desiccated font (#104). Instead at each level of invalidating extension we should determine what the maximum reachable glyph id is and ensure the loca/gvar/CFF/CFF2 offsets arrays are large enough to accomadate.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at ift/encoder/encoder.cc#L219 and trace how mixed encodings build each level of invalidating extension and reachable glyph patches. Replace the initial last-gid inclusion with per-level maximum reachable glyph-id handling, ensuring the loca/gvar/CFF/CFF2 offset arrays can accommodate those glyphs and no longer depend on the hack.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100