File tree 1 file changed +26
-0
lines changed
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,26 @@ impl CGFont {
102
102
}
103
103
}
104
104
105
+ pub fn ascent ( & self ) -> c_int {
106
+ unsafe { CGFontGetAscent ( self . as_ptr ( ) ) }
107
+ }
108
+
109
+ pub fn descent ( & self ) -> c_int {
110
+ unsafe { CGFontGetDescent ( self . as_ptr ( ) ) }
111
+ }
112
+
113
+ pub fn leading ( & self ) -> c_int {
114
+ unsafe { CGFontGetLeading ( self . as_ptr ( ) ) }
115
+ }
116
+
117
+ pub fn cap_height ( & self ) -> c_int {
118
+ unsafe { CGFontGetCapHeight ( self . as_ptr ( ) ) }
119
+ }
120
+
121
+ pub fn x_height ( & self ) -> c_int {
122
+ unsafe { CGFontGetXHeight ( self . as_ptr ( ) ) }
123
+ }
124
+
105
125
pub fn get_units_per_em ( & self ) -> c_int {
106
126
unsafe { CGFontGetUnitsPerEm ( self . as_ptr ( ) ) }
107
127
}
@@ -170,6 +190,12 @@ extern "C" {
170
190
count : size_t ,
171
191
advances : * mut c_int ,
172
192
) -> bool ;
193
+
194
+ fn CGFontGetAscent ( font : crate :: sys:: CGFontRef ) -> c_int ;
195
+ fn CGFontGetDescent ( font : crate :: sys:: CGFontRef ) -> c_int ;
196
+ fn CGFontGetLeading ( font : crate :: sys:: CGFontRef ) -> c_int ;
197
+ fn CGFontGetCapHeight ( font : crate :: sys:: CGFontRef ) -> c_int ;
198
+ fn CGFontGetXHeight ( font : crate :: sys:: CGFontRef ) -> c_int ;
173
199
fn CGFontGetUnitsPerEm ( font : crate :: sys:: CGFontRef ) -> c_int ;
174
200
175
201
fn CGFontCopyTableTags ( font : crate :: sys:: CGFontRef ) -> CFArrayRef ;
You can’t perform that action at this time.
0 commit comments