googlefonts / googlefonts/fontc

A possible optimization in storage of GPOS 2 (pair pos/kerning) subtables

Open
#529 1 comment 0 reactions 0 assignees View on GitHub
performance
Dominant language
Rust
Stars
193
Forks
21
Avg merge
1d 20h
Merged PRs (30d)
60

Description

In the process of trying to make sense of the existing GPOS glyph I noticed that there is an opportunity for a small savings in binary size in some circumstances, related to how we compile [PairPos format 1](https://learn.microsoft.com/en-us/typography/opentype/spec/gpos#pair-adjustment-positioning-format-1-adjustments-for-glyph-pairs) tables.

To summarize: for every pair of `ValueFormat`s, we create a new subtable. However it should be totally fine to use a `ValueFormat` that is a superset of the original, which means that we should be able to merge these subtables in some cases.

The savings here are very marginal (optimistically maybe a couple hundred bytes) and I am not sure if there are any other benefits to reducing the number of subtables, but I wanted to at least capture the idea.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the Rust code that compiles GPOS PairPos format 1 tables and creates subtables for each ValueFormat pair. Review how compatible ValueFormats could be merged, then verify that the resulting output remains valid and can reduce binary size in applicable cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.