From d7b3893a2b3ec4502c9b6f4610cc3563be2ed010 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Thu, 2 Aug 2018 14:36:53 -0700 Subject: [PATCH] Add a binding to `CTFontGetGlyphCount()` --- core-text/src/font.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core-text/src/font.rs b/core-text/src/font.rs index 103d745..88210d7 100644 --- a/core-text/src/font.rs +++ b/core-text/src/font.rs @@ -393,6 +393,13 @@ impl CTFont { } } } + + #[inline] + pub fn glyph_count(&self) -> CFIndex { + unsafe { + CTFontGetGlyphCount(self.0) + } + } } // Helper methods @@ -540,7 +547,7 @@ extern { fn CTFontGetDescent(font: CTFontRef) -> CGFloat; fn CTFontGetLeading(font: CTFontRef) -> CGFloat; fn CTFontGetUnitsPerEm(font: CTFontRef) -> libc::c_uint; - //fn CTFontGetGlyphCount + fn CTFontGetGlyphCount(font: CTFontRef) -> CFIndex; fn CTFontGetBoundingBox(font: CTFontRef) -> CGRect; fn CTFontGetUnderlinePosition(font: CTFontRef) -> CGFloat; fn CTFontGetUnderlineThickness(font: CTFontRef) -> CGFloat;