We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b427c7d + f8b2abf commit f4b01d2Copy full SHA for f4b01d2
core-text/src/font_descriptor.rs
@@ -278,6 +278,17 @@ impl CTFontDescriptor {
278
CFDictionary::wrap_under_get_rule(value.as_CFTypeRef() as CFDictionaryRef)
279
}
280
281
+
282
+ pub fn create_copy_with_attributes(&self, attr: CFDictionary) -> Result<CTFontDescriptor, ()> {
283
+ unsafe {
284
+ let desc = CTFontDescriptorCreateCopyWithAttributes(self.as_concrete_TypeRef(),
285
+ attr.as_concrete_TypeRef());
286
+ if desc.is_null() {
287
+ return Err(());
288
+ }
289
+ Ok(CTFontDescriptor::wrap_under_create_rule(desc))
290
291
292
293
294
pub fn new_from_attributes(attributes: &CFDictionary<CFString, CFType>) -> CTFontDescriptor {
0 commit comments