Friday, November 6, 2026
HomeiOS Developmentios - Registered font not getting after reopen software

ios – Registered font not getting after reopen software

[ad_1]

I’m utilizing Font from UIDocumentPickerViewController and I’m efficiently registered font and likewise get UIFont.households. However as soon as I kill the applying after which reopen software then I cannot get that font in UIFont.households. I used bellow code

func handleFileSelection(inUrl:URL) -> Void {
do {
    // inUrl is the doc's URL
    let fontData = strive Knowledge(contentsOf: inUrl) // Getting file information right here
    let dataProvider = CGDataProvider(information: fontData as CFData)
    let cgFont = CGFont(dataProvider
   
    var error: Unmanaged<CFError>?
    if !CTFontManagerRegisterGraphicsFont(cgFont!, &error)
    {
        print("Error loading Font!")
    } else {}
        let fontName = cgFont!.postScriptName
        self.lblText.font = UIFont.init(identify: "(fontName!)", dimension: 25.0)
        self.lblText.textual content = "(fontName!)"
    } catch {
        print("doc loading error")
    }
}

If I’m lacking one thing please let me know.

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments