alexheretic / ab-glyph

Rust API for loading, scaling, positioning and rasterizing OpenType font glyphs
Apache License 2.0
372 stars 24 forks source link

Add FontRef::from_face function. #110

Closed coevolutions closed 1 week ago

coevolutions commented 1 month ago

This allows FontRefs to be already created from pre-parsed faces. This can be useful to avoid having to reparse a face if we already have one, e.g. if we want to do shaping with rustybuzz, we should already have a parsed face and parsing it a second time is wasteful.

alexheretic commented 1 month ago

This would expose ttf-parser api publicly which is something I deliberately avoid here for semver stability.

coevolutions commented 1 month ago

I see - I would like to avoid having to reparse the Face though if I already have it. Would you be okay with hiding it behind a feature flag?

alexheretic commented 1 week ago

Features also impact semver, i know of no correct way to workaround that.

Shielding this crate from upstream semver breaks prohibits use of upstream anywhere in the public api. Perhaps this is something we could revisit if ttf-parser stabilised e.g. on a v1.0.0. But currently upstream makes breaking changes routinely.