Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Better kerning & groups tooling #331

Open
RickyDaMa opened this issue Oct 27, 2023 · 1 comment
Open

Better kerning & groups tooling #331

RickyDaMa opened this issue Oct 27, 2023 · 1 comment
Labels
discussion enhancement New feature or request

Comments

@RickyDaMa
Copy link
Collaborator

RickyDaMa commented Oct 27, 2023

Working with kerning & groups in code has been a pain every time I've had to do it, and a lot of that comes from having relatively basic functionality not being available because both Python & Rust libraries; they just expose raw dictionary/map types and provide zero convenience methods. This has become somewhat of a pet peeve of mine and something I'd like to fix.

Some of my ideas are as follows, and I'd like to gauge interest/discuss them before starting work:

  1. Kerning look-up methods (one with group resolution, one without)
  2. Kerning/Group modifying methods that uphold invariants (as opposed to validation on write-to-disk)
  3. Generating reverse look-ups for kerning & groups
  4. Transparent caching of reverse look-ups to make resolving kerns faster (transparent as in, requires no thought/involvement from the library user at any point, will require interior mutability)
  5. Renaming group method
  6. Culling empty groups method
  7. Culling 0 kerns method

The breaking change would be privatising Font.kerning and Font.groups and/or changing the underlying type. Interested in hearing any use cases for kerning/group information beyond what I've outlined in my points. Iterating over groups/kerning would of course still be available

@RickyDaMa RickyDaMa added enhancement New feature or request discussion labels Oct 27, 2023
@madig
Copy link
Collaborator

madig commented Nov 16, 2023

Use case I just stumbled over: a Kerning::retain method that yields (first, second, value) so I don't have to do the map denesting myself.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
discussion enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants