diff --git a/src/uharfbuzz/_harfbuzz.pyx b/src/uharfbuzz/_harfbuzz.pyx index d11b7c0..f8653c4 100644 --- a/src/uharfbuzz/_harfbuzz.pyx +++ b/src/uharfbuzz/_harfbuzz.pyx @@ -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) diff --git a/src/uharfbuzz/charfbuzz.pxd b/src/uharfbuzz/charfbuzz.pxd index 9dc525f..2668144 100644 --- a/src/uharfbuzz/charfbuzz.pxd +++ b/src/uharfbuzz/charfbuzz.pxd @@ -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) diff --git a/tests/test_uharfbuzz.py b/tests/test_uharfbuzz.py index 97b2ba4..f762d3c 100644 --- a/tests/test_uharfbuzz.py +++ b/tests/test_uharfbuzz.py @@ -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