Skip to content

GlyphBuffer.serialize should accept format flags #12

Description

@hasanzakeri

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:

  1. Accept a string flag list (gbuf.serialize(font, "no-clusters,no-positions"))
  2. Accept boolean kwargs (gbuf.serialize(font, no_clusters=True, ...))
  3. Add a SerializeFlags Python class wrapping the bitflags

Option 2 is the most Pythonic for an API surface this small.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions