googlefonts / googlefonts/fontations

Implement delta compression for gvar (compute interpolatable points)

Open
#334 3 comments 0 reactions 0 assignees View on GitHub
optimization
Dominant language
Rust
Stars
826
Forks
75
Avg merge
22h 33m
Merged PRs (30d)
75

Description

This was omitted from the initial implementation of compiling gvar, but is a desirable optimization.

I've never written this code, on either the compilation or parsing side, and so it will require a little bit of experimentation. Finding the optimal solution is also complicated, because if two delta sets for a given glyph have a non-shared set of interpolatable points then it will require us to store two copies of the packed point numbers, which may negate the savings from interpolation in some cases.

An optimal solution (but perhaps overkill) would maybe involve computing the possible interpolations for each delta set, determine the total resulting compile size, and then determine if we can reduce compile size by discarding certain interpolatable points in certain delta sets in order to let us reuse a set of point numbers.

A less complicated and also-reasonable solution would be to compute the interpolations for each delta set, and then determine, (per set) whether the compile size of the interpolated deltas + the packed point numbers is less than the deltas for all points.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.