pub struct CTMutableFontCollection { /* private fields */ }
CTFontCollection
only.Expand description
This is toll-free bridged with NSMutableFontCollection
.
Implementations§
Source§impl CTMutableFontCollection
impl CTMutableFontCollection
Sourcepub unsafe fn new_copy(
original: &CTFontCollection,
) -> CFRetained<CTMutableFontCollection>
pub unsafe fn new_copy( original: &CTFontCollection, ) -> CFRetained<CTMutableFontCollection>
Returns a mutable copy of the original collection.
Parameter original
: The original font collection reference.
Returns: This function creates a mutable copy of the original font collection.
Source§impl CTMutableFontCollection
impl CTMutableFontCollection
Sourcepub unsafe fn set_query_descriptors(&self, descriptors: Option<&CFArray>)
pub unsafe fn set_query_descriptors(&self, descriptors: Option<&CFArray>)
Replaces the array of descriptors to match.
Parameter collection
: The font collection reference.
Parameter descriptors
: An array of CTFontDescriptorRef. May be NULL to represent an empty collection, in which case the matching descriptors will also be NULL.
§Safety
descriptors
generic must be of the correct type.
Source§impl CTMutableFontCollection
impl CTMutableFontCollection
Sourcepub unsafe fn set_exclusion_descriptors(&self, descriptors: Option<&CFArray>)
pub unsafe fn set_exclusion_descriptors(&self, descriptors: Option<&CFArray>)
Replaces the array of descriptors to exclude from the match.
Parameter collection
: The font collection reference.
Parameter descriptors
: An array of CTFontDescriptorRef. May be NULL.
§Safety
descriptors
generic must be of the correct type.
Methods from Deref<Target = CTFontCollection>§
Sourcepub unsafe fn copy_with_font_descriptors(
&self,
query_descriptors: Option<&CFArray>,
options: Option<&CFDictionary>,
) -> CFRetained<CTFontCollection>
pub unsafe fn copy_with_font_descriptors( &self, query_descriptors: Option<&CFArray>, options: Option<&CFDictionary>, ) -> CFRetained<CTFontCollection>
Returns a copy of the original collection augmented with the new font descriptors.
Parameter original
: The original font collection reference.
Parameter queryDescriptors
: An array of font descriptors to augment those of the original collection.
Parameter options
: The options dictionary. See constant option keys.
Returns: This function creates a copy of the original font collection augmented by the new font descriptors and options. The new font descriptors are merged with the existing descriptors to create a single set.
§Safety
query_descriptors
generic must be of the correct type.options
generics must be of the correct type.
Sourcepub unsafe fn query_descriptors(&self) -> Option<CFRetained<CFArray>>
pub unsafe fn query_descriptors(&self) -> Option<CFRetained<CFArray>>
Returns the array of descriptors to match.
Parameter collection
: The font collection reference.
Returns: This function returns a retained reference to the array of descriptors to be used to query (match) the system font database. The return value is undefined if CTFontCollectionCreateFromAvailableFonts was used to create the collection.
Sourcepub unsafe fn exclusion_descriptors(&self) -> Option<CFRetained<CFArray>>
pub unsafe fn exclusion_descriptors(&self) -> Option<CFRetained<CFArray>>
Returns the array of descriptors to exclude from the match.
Parameter collection
: The font collection reference.
Returns: This function returns a retained reference to the array of descriptors to be used to query (match) the system font database.
Sourcepub unsafe fn matching_font_descriptors(&self) -> Option<CFRetained<CFArray>>
pub unsafe fn matching_font_descriptors(&self) -> Option<CFRetained<CFArray>>
Returns an array of font descriptors matching the collection.
Parameter collection
: The font collection reference.
Returns: An array of CTFontDescriptors matching the collection definition or NULL if there are none.
Sourcepub unsafe fn matching_font_descriptors_sorted_with_callback(
&self,
sort_callback: CTFontCollectionSortDescriptorsCallback,
ref_con: *mut c_void,
) -> Option<CFRetained<CFArray>>
Available on crate feature CTFontDescriptor
only.
pub unsafe fn matching_font_descriptors_sorted_with_callback( &self, sort_callback: CTFontCollectionSortDescriptorsCallback, ref_con: *mut c_void, ) -> Option<CFRetained<CFArray>>
CTFontDescriptor
only.Returns the array of matching font descriptors sorted with the callback function.
Parameter collection
: The collection reference.
Parameter sortCallback
: The sorting callback function that defines the sort order.
Parameter refCon
: Pointer to client data define context for the callback.
Returns: An array of CTFontDescriptors matching the criteria of the collection, sorted by the results of the sorting callback function, or NULL if there are none.
§Safety
sort_callback
must be implemented correctly.ref_con
must be a valid pointer or null.
Sourcepub unsafe fn matching_font_descriptors_with_options(
&self,
options: Option<&CFDictionary>,
) -> Option<CFRetained<CFArray>>
pub unsafe fn matching_font_descriptors_with_options( &self, options: Option<&CFDictionary>, ) -> Option<CFRetained<CFArray>>
Returns an array of font descriptors matching the collection.
Parameter collection
: The font collection reference.
Parameter options
: The options dictionary. See constant option keys. May be NULL, in which case this call returns the same results as CTFontCollectionCreateMatchingFontDescriptors, using the options passed in when the collection was created.
Returns: An array of CTFontDescriptors matching the collection definition or NULL if there are none.
§Safety
options
generics must be of the correct type.
Sourcepub unsafe fn matching_font_descriptors_for_family(
&self,
family_name: &CFString,
options: Option<&CFDictionary>,
) -> Option<CFRetained<CFArray>>
pub unsafe fn matching_font_descriptors_for_family( &self, family_name: &CFString, options: Option<&CFDictionary>, ) -> Option<CFRetained<CFArray>>
Returns an array of font descriptors matching the specified family, one descriptor for each style in the collection.
Parameter collection
: The font collection reference.
Parameter familyName
: The font family name
Returns: An array of CTFontDescriptors matching the specified family in the collection or NULL if there are none.
§Safety
options
generics must be of the correct type.
Sourcepub unsafe fn font_attribute(
&self,
attribute_name: &CFString,
options: CTFontCollectionCopyOptions,
) -> CFRetained<CFArray>
pub unsafe fn font_attribute( &self, attribute_name: &CFString, options: CTFontCollectionCopyOptions, ) -> CFRetained<CFArray>
Returns an array of font descriptor attribute values.
Parameter collection
: The font collection reference.
Parameter attributeName
: The attribute to retrieve for each descriptor in the collection.
Parameter options
: Options to alter the return value.
Returns: An array containing one value for each descriptor. With kCTFontCollectionCopyDefaultOptions, the values will be in the same order as the results from CTFontCollectionCreateMatchingFontDescriptors and NULL values will be transformed to kCFNull. When the kCTFontCollectionCopyUnique is set, duplicate values will be removed. When kCTFontCollectionCopyStandardSort is set, the values will be sorted in standard UI order.
Sourcepub unsafe fn font_attributes(
&self,
attribute_names: &CFSet,
options: CTFontCollectionCopyOptions,
) -> CFRetained<CFArray>
pub unsafe fn font_attributes( &self, attribute_names: &CFSet, options: CTFontCollectionCopyOptions, ) -> CFRetained<CFArray>
Returns an array of dictionaries containing font descriptor attribute values.
Parameter collection
: The font collection reference.
Parameter attributeNames
: The attributes to retrieve for each descriptor in the collection.
Parameter options
: Options to alter the return value.
Returns: An array containing one CFDictionary value for each descriptor mapping the requested attribute names. With kCTFontCollectionCopyDefaultOptions, the values will be in the same order as the results from CTFontCollectionCreateMatchingFontDescriptors. When the kCTFontCollectionCopyUnique is set, duplicate values will be removed. When kCTFontCollectionCopyStandardSort is set, the values will be sorted in standard UI order.
§Safety
attribute_names
generic must be of the correct type.
Methods from Deref<Target = CFType>§
Sourcepub fn downcast_ref<T>(&self) -> Option<&T>where
T: ConcreteType,
pub fn downcast_ref<T>(&self) -> Option<&T>where
T: ConcreteType,
Attempt to downcast the type to that of type T
.
This is the reference-variant. Use CFRetained::downcast
if you
want to convert a retained type. See also ConcreteType
for more
details on which types support being converted to.
Sourcepub fn retain_count(&self) -> usize
pub fn retain_count(&self) -> usize
Get the reference count of the object.
This function may be useful for debugging. You normally do not use this function otherwise.
Beware that some things (like CFNumber
s, small CFString
s etc.) may
not have a normal retain count for optimization purposes, and can
return usize::MAX
in that case.
Trait Implementations§
Source§impl AsRef<AnyObject> for CTMutableFontCollection
impl AsRef<AnyObject> for CTMutableFontCollection
Source§impl AsRef<CFType> for CTMutableFontCollection
impl AsRef<CFType> for CTMutableFontCollection
Source§impl AsRef<CTFontCollection> for CTMutableFontCollection
impl AsRef<CTFontCollection> for CTMutableFontCollection
Source§fn as_ref(&self) -> &CTFontCollection
fn as_ref(&self) -> &CTFontCollection
Source§impl Borrow<AnyObject> for CTMutableFontCollection
impl Borrow<AnyObject> for CTMutableFontCollection
Source§impl Borrow<CFType> for CTMutableFontCollection
impl Borrow<CFType> for CTMutableFontCollection
Source§impl Borrow<CTFontCollection> for CTMutableFontCollection
impl Borrow<CTFontCollection> for CTMutableFontCollection
Source§fn borrow(&self) -> &CTFontCollection
fn borrow(&self) -> &CTFontCollection
Source§impl Debug for CTMutableFontCollection
impl Debug for CTMutableFontCollection
Source§impl Deref for CTMutableFontCollection
impl Deref for CTMutableFontCollection
Source§impl Hash for CTMutableFontCollection
impl Hash for CTMutableFontCollection
Source§impl Message for CTMutableFontCollection
impl Message for CTMutableFontCollection
Source§impl PartialEq for CTMutableFontCollection
impl PartialEq for CTMutableFontCollection
Source§impl RefEncode for CTMutableFontCollection
impl RefEncode for CTMutableFontCollection
Source§const ENCODING_REF: Encoding
const ENCODING_REF: Encoding
Source§impl Type for CTMutableFontCollection
impl Type for CTMutableFontCollection
Source§fn retain(&self) -> CFRetained<Self>where
Self: Sized,
fn retain(&self) -> CFRetained<Self>where
Self: Sized,
Source§fn as_concrete_TypeRef(&self) -> &Self
fn as_concrete_TypeRef(&self) -> &Self
core-foundation
crate.Source§unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
core-foundation
crate. Read moreSource§fn as_CFTypeRef(&self) -> &CFType
fn as_CFTypeRef(&self) -> &CFType
core-foundation
crate.Source§unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self>where
Self: Sized,
core-foundation
crate. Read more