Open dbuenzli opened 2 years ago
Your assertion about how to calculate the advance width value in the metadata is indeed correct. The data is reproduced in the JSON metadata files so that applications that don't have ready access to the internals of the font tables can have information about these values. These values were initially added to the specification at the request of developers from MakeMusic as it was important for the way that Finale's font annotation tables (in .fan files) work.
It seems to me that
glyphAdvancesWidths
is simply repeating the same information you can find in the OpenTypehmtx
table. Basically for a glyph this is simply:Where
advanceWidth
is the value found in thehmtx
table for the glyph andunitsPerEm
the corresponding field in the unitsPerEm field of thehead
table and the multiplication by 4 to convert to staff space.Is that correct ?
If it is, I'm not sure I understand the rationale of having such derived data, it increases the chances for metrics to go out of sync and poses the question of which one to use.
I tried to compute my own
glyphAdvancesWidths
on this Bravura.otf font using the above formula to compare it with this json metadata and all the computations match except for the following glyphs:So which one should we trust ? The
json
metadata or the OpenType metrics ? Maybe the spec should have a few words on this.