File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -194,6 +194,10 @@ declare_TCFType! {
194
194
impl_TCFType ! ( CTFontDescriptor , CTFontDescriptorRef , CTFontDescriptorGetTypeID ) ;
195
195
impl_CFTypeDescription ! ( CTFontDescriptor ) ;
196
196
197
+ // "Font objects (CTFont, CTFontDescriptor, and associated objects) can be used
198
+ // simultaneously by multiple operations, work queues, or threads."
199
+ unsafe impl Send for CTFontDescriptor { }
200
+ unsafe impl Sync for CTFontDescriptor { }
197
201
198
202
impl CTFontDescriptor {
199
203
fn get_string_attribute ( & self , attribute : CFStringRef ) -> Option < String > {
@@ -289,6 +293,13 @@ impl CTFontDescriptor {
289
293
Ok ( CTFontDescriptor :: wrap_under_create_rule ( desc) )
290
294
}
291
295
}
296
+
297
+ pub fn attributes ( & self ) -> CFDictionary < CFString , CFType > {
298
+ unsafe {
299
+ let attrs = CTFontDescriptorCopyAttributes ( self . as_concrete_TypeRef ( ) ) ;
300
+ CFDictionary :: wrap_under_create_rule ( attrs)
301
+ }
302
+ }
292
303
}
293
304
294
305
pub fn new_from_attributes ( attributes : & CFDictionary < CFString , CFType > ) -> CTFontDescriptor {
You can’t perform that action at this time.
0 commit comments