CTMutableFontCollection

Struct CTMutableFontCollection 

Source
pub struct CTMutableFontCollection { /* private fields */ }
Available on crate feature CTFontCollection only.
Expand description

Apple’s documentation

This is toll-free bridged with NSMutableFontCollection.

Implementations§

Source§

impl CTMutableFontCollection

Source

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

Source

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

Source

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>§

Source

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.
Source

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.

Source

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.

Source

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.

Source

pub 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.

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.
Source

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.

Source

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.

Source

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.

Source

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>§

Source

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.

Source

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 CFNumbers, small CFStrings 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

Source§

fn as_ref(&self) -> &AnyObject

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<CFType> for CTMutableFontCollection

Source§

fn as_ref(&self) -> &CFType

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<CTFontCollection> for CTMutableFontCollection

Source§

fn as_ref(&self) -> &CTFontCollection

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<CTMutableFontCollection> for CTMutableFontCollection

Source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Borrow<AnyObject> for CTMutableFontCollection

Source§

fn borrow(&self) -> &AnyObject

Immutably borrows from an owned value. Read more
Source§

impl Borrow<CFType> for CTMutableFontCollection

Source§

fn borrow(&self) -> &CFType

Immutably borrows from an owned value. Read more
Source§

impl Borrow<CTFontCollection> for CTMutableFontCollection

Source§

fn borrow(&self) -> &CTFontCollection

Immutably borrows from an owned value. Read more
Source§

impl Debug for CTMutableFontCollection

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for CTMutableFontCollection

Source§

type Target = CTFontCollection

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Hash for CTMutableFontCollection

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Message for CTMutableFontCollection

Source§

fn retain(&self) -> Retained<Self>
where Self: Sized,

Increment the reference count of the receiver. Read more
Source§

impl PartialEq for CTMutableFontCollection

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl RefEncode for CTMutableFontCollection

Source§

const ENCODING_REF: Encoding

The Objective-C type-encoding for a reference of this type. Read more
Source§

impl Type for CTMutableFontCollection

Source§

fn retain(&self) -> CFRetained<Self>
where Self: Sized,

Increment the reference count of the receiver. Read more
Source§

fn as_concrete_TypeRef(&self) -> &Self

👎Deprecated: this is redundant
Helper for easier transition from the core-foundation crate.
Source§

unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self>
where Self: Sized,

👎Deprecated: use CFRetained::retain
Helper for easier transition from the core-foundation crate. Read more
Source§

fn as_CFTypeRef(&self) -> &CFType
where Self: AsRef<CFType>,

👎Deprecated: this is redundant (CF types deref to CFType)
Helper for easier transition from the core-foundation crate.
Source§

unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self>
where Self: Sized,

👎Deprecated: use CFRetained::from_raw
Helper for easier transition from the core-foundation crate. Read more
Source§

impl Eq for CTMutableFontCollection

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> AutoreleaseSafe for T
where T: ?Sized,