alexheretic / ab-glyph

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

OTF feature tags #74

Open emilk opened 1 year ago

emilk commented 1 year ago

OTF files have feature flags, like tnum.

It would be wonderful to be able to enable such flags in ab-glyph

alexheretic commented 1 year ago

Yet it would be nice to have. The first step would be figuring out exactly how they work using ttf-parser crate.

simoncozens commented 1 year ago

You're going to need a shaping engine like harfbuzz_rs/rustybuzz/allsorts to execute the substitution and positioning rules in the GSUB/GPOS tables stored with each feature. It does get very complicated (particularly with lookup flags and especially with complex scripts), so I would advise against trying to implement shaping in this crate / with ttf-parser.