[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]
