googlefonts / fontations

Reading and writing font files
Apache License 2.0
363 stars 22 forks source link

What would it take to support u24 or u32 glyph ids? #118

Open rsheeter opened 1 year ago

rsheeter commented 1 year ago

Just want to be sure we aren't painting ourselves into a corner.

cmyr commented 1 year ago

We have a few options: one simple one would be to have a GlyphId trait, which would be implemented for GlyphId, GlyphId24, and GlyphId32. Alternatively we could convert all glyph ids to a single type (u32) when we read them.

rsheeter commented 1 year ago

For reading being able to just always have u32 seems fine. Presumably the compiler needs direct control over width. If we u32 on read would that impede the compiler?

cmyr commented 1 year ago

nope, codegen would know the underlying types and so would generate the correct representation for compilation.