googlefonts / fontations

Reading and writing font files
Apache License 2.0
396 stars 26 forks source link

hhea/vhea numberOfHMetrics has become number_of_long_metrics #1213

Open simoncozens opened 3 weeks ago

simoncozens commented 3 weeks ago

Generally the names of fields in read-fonts follows the names in the OpenType specification; so it's confusing when they don't.

The spec has

uint16 numberOfHMetrics Number of hMetric entries in 'hmtx' table

but hhea.rs has:

    /// Number of LongMetric entries in 'hmtx'/'vmtx' table
    number_of_long_metrics: u16,

read-fonts's is probably a better name, but it causes a mental "wait, are these the same thing or not?" moment. A doc comment would be helpful.