Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Remove the "last gid" hack from encoder implementation

Open
#108 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
tooling

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.

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.

Dominant language
C++
Stars
13
Forks
9
Avg merge
14h 50m
Merged PRs (30d)
6

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from w3c/ift-encoder

All issues in w3c/ift-encoder

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.