Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Make hb-ot-* bindings more Pythonic #209

Merged
merged 6 commits into from
Sep 19, 2024
Merged

Make hb-ot-* bindings more Pythonic #209

merged 6 commits into from
Sep 19, 2024

Conversation

khaledhosny
Copy link
Collaborator

They were added as top level functions, but that feels odd on Python when we already have Face and Font classes. This deprecate the top level functions and adds corresponding methods to Face or Font classes as appropriate.

Instead of module-level ot_math_* functions, make them methods of Face
or Font classes, as appropriate.
Instead of module-level ot_metric_* functions, make them methods of Face
or Font classes, as appropriate.
Instead of module-level ot_color_* functions, make them methods of Face
or Font classes, as appropriate.

Also simplify getting color palettes.
Instead of module-level ot_layout_* functions, make them methods of Face
or Font classes, as appropriate.

A couple of functions that don’t take Face or Font as input were left unchanged.
@behdad
Copy link
Member

behdad commented Sep 16, 2024

LGTM. Thanks.

@khaledhosny khaledhosny merged commit a0b575a into main Sep 19, 2024
4 checks passed
@khaledhosny khaledhosny deleted the pythonic-api branch September 19, 2024 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants