ttf-explorer icon indicating copy to clipboard operation
ttf-explorer copied to clipboard

gvar: too many deltas read

Open wezm opened this issue 11 months ago • 1 comments

First up, I wanted to pass on my thanks for building this tool. I find it very useful for investigating font related issues.

Whilst building out gvar support in Allsorts I noticed a bug in the reading of the deltas:

https://github.com/RazrFalcon/ttf-explorer/blob/ff6eab3616824a54c466ab28da43464a8a2540f3/src/tables/gvar.cpp#L51

This code can end up reading too many deltas. It's supposed to stop when a delta for for each point number has been read but I'm seeing it read more than that (also verified against ttx from fonttools):

Packed delta data does not include the total number of delta values within the data. Logically, there are deltas for every point number or CVT index specified in the point-number data. Thus, the count of logical deltas is equal to the count of point numbers specified for that tuple variation table.

— https://learn.microsoft.com/en-us/typography/opentype/spec/otvarcommonformats#packed-deltas

I understand if addressing this is not a priority, just thought I'd mention it.

wezm avatar Aug 09 '23 06:08 wezm