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

Bind hb_face_count APIs #221

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/uharfbuzz/_harfbuzz.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,10 @@ cdef class Face:
inst._reference_table_func = func
return inst

@property
def count(self) -> int:
return hb_face_count(self._blob._hb_blob)

@property
def index(self) -> int:
return hb_face_get_index(self._hb_face)
Expand Down
1 change: 1 addition & 0 deletions src/uharfbuzz/charfbuzz.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ cdef extern from "hb.h":
hb_face_t* hb_face_create_for_tables(
hb_reference_table_func_t reference_table_func,
void* user_data, hb_destroy_func_t destroy)
unsigned int hb_face_count(hb_blob_t* blob)
unsigned int hb_face_get_index(const hb_face_t* face)
void hb_face_set_index(hb_face_t* face, unsigned int index)
unsigned int hb_face_get_upem(hb_face_t* face)
Expand Down
1 change: 1 addition & 0 deletions tests/test_uharfbuzz.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ class TestFace:
def test_properties(self, blankfont):
face = blankfont.face

assert face.count > 0
assert face.index == 0
assert face.upem == 1000
assert face.glyph_count == 9
Expand Down
Loading