pub unsafe extern "C-unwind" fn CTFontManagerRegisterFontsWithAssetNames(
font_asset_names: &CFArray,
bundle: Option<&CFBundle>,
scope: CTFontManagerScope,
enabled: bool,
registration_handler: Option<&DynBlock<dyn Fn(NonNull<CFArray>, bool) -> bool>>,
)CTFontManager and block2 only.Expand description
Registers named font assets in the specified bundle with the font manager. Registered fonts are discoverable through font descriptor matching in the calling process.
Font assets are extracted from the asset catalog and registered. This call must be made after the completion handler of either NSBundleResourceRequest beginAccessingResourcesWithCompletionHandler: or conditionallyBeginAccessingResourcesWithCompletionHandler: is called successfully. Name the assets using Postscript names for individual faces, or family names for variable/collection fonts. The same names can be used to unregister the fonts with CTFontManagerUnregisterFontDescriptors. 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 fontAssetNames: Array of font name assets in asset catalog.
Parameter bundle: Bundle containing asset catalog. A null value resolves to the main bundle.
Parameter scope: Scope constant defining the availability and lifetime of the registration. kCTFontManagerScopePersistent is the only supported scope for iOS.
Parameter enabled: Boolean value indicating whether the font assets 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 asset names corresponding to kCTFontManagerErrorFontAssetNameKey. These represent the font asset names that 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_asset_names generic must be of the correct type.