pub unsafe extern "C-unwind" fn CTFontManagerRegisterFontDescriptors(
font_descriptors: &CFArray,
scope: CTFontManagerScope,
enabled: bool,
registration_handler: Option<&DynBlock<dyn Fn(NonNull<CFArray>, bool) -> bool>>,
)CTFontManager and block2 only.Expand description
Registers font descriptors with the font manager. Registered fonts are discoverable through font descriptor matching in the calling process.
Fonts descriptors registered in disabled state are not immediately available for descriptor matching but the font manager will know the descriptors could be made available if necessary. These decriptors can be enabled by making this called again with the enabled parameter set to true. This operation may fail if there is another font registered and enabled with the same Postscript name. In iOS, fonts registered with the persistent scope are not automatically available to other processes. Other process may call CTFontManagerRequestFonts to get access to these fonts.
Parameter fontDescriptors: Array of font descriptors to register. Font descriptor keys used for registration are: kCTFontURLAttribute, kCTFontNameAttribute, kCTFontFamilyNameAttribute, or kCTFontRegistrationUserInfoAttribute.
Parameter scope: Scope constant defining the availability and lifetime of the registration. See scope constants for more details.
Parameter enabled: Boolean value indicating whether the font descriptors should be enabled for font descriptor matching and/or discoverable via CTFontManagerRequestFonts.
Parameter registrationHandler: Block called as errors are discovered or upon completion. The errors parameter contains an array of CFError references. An empty array indicates no errors. Each error reference will contain a CFArray of font descriptors corresponding to kCTFontManagerErrorFontDescriptorsKey. These represent the font descriptors that caused the error, and were not successfully registered. Note, the handler may be called multiple times during the registration process. The done parameter will be set to true when the registration process has completed. The handler should return false if the operation is to be stopped. This may be desirable after receiving an error.
ยงSafety
font_descriptors generic must be of the correct type.