hr_shape::shape() exposes --no-glyph-names, --no-clusters, --no-positions, --no-advances, --glyph-extents, --glyph-flags via SerializeFlags. Our object API hardcodes SerializeFlags::default().
For Phase 5 this is fine — default() matches the format used by harfrust.shape() so the parity test holds. But it means the object API is strictly less expressive than the string API.
Options:
- Accept a string flag list (
gbuf.serialize(font, "no-clusters,no-positions"))
- Accept boolean kwargs (
gbuf.serialize(font, no_clusters=True, ...))
- Add a
SerializeFlags Python class wrapping the bitflags
Option 2 is the most Pythonic for an API surface this small.
hr_shape::shape()exposes--no-glyph-names,--no-clusters,--no-positions,--no-advances,--glyph-extents,--glyph-flagsviaSerializeFlags. Our object API hardcodesSerializeFlags::default().For Phase 5 this is fine —
default()matches the format used byharfrust.shape()so the parity test holds. But it means the object API is strictly less expressive than the string API.Options:
gbuf.serialize(font, "no-clusters,no-positions"))gbuf.serialize(font, no_clusters=True, ...))SerializeFlagsPython class wrapping the bitflagsOption 2 is the most Pythonic for an API surface this small.