Özel yazı tiplerini imglyKit SDK'ya eklemek için şu kodu denedim ancak özel yazı tipi eklenmedi. Ben de .ttf dosyasını bir kaynak olarak info.plist dosyasına koydum.Swift ile iOS'ta imglyKit SDK'ye özel yazı tipi nasıl eklenir?
let sampleImage = image.image
let configuration = Configuration() { builder in
FontImporter.init().importFonts()
builder.configurePhotoEditorViewController({ (editPhotoOption) in
editPhotoOption.allowedPhotoEditorActions = [.text]
editPhotoOption.actionButtonConfigurationClosure = {cell, _ in
cell.captionLabel.text = "Add Text"
//cell.backgroundColor = UIColor.red
}
editPhotoOption.backgroundColor = UIColor.brown
editPhotoOption.allowsPreviewImageZoom = false
})
builder.configureToolStackController({ (toolStackOption) in
toolStackOption.mainToolbarBackgroundColor = UIColor.red
toolStackOption.secondaryToolbarBackgroundColor = UIColor.brown
})
builder.configureTextFontToolController({ (textFontToolOption) in
var fontArray = [String]()
fontArray = ["AlexBrush_Regular.ttf", "Arabella.ttf"]
textFontToolOption.accessibilityElements = fontArray
textFontToolOption.actionButtonConfigurationClosure = { cell, _ in
cell.backgroundColor = UIColor.red
}
})
builder.configureTextToolController({ (textToolOption) in
textToolOption.textViewConfigurationClosure = { label in
label.textAlignment = NSTextAlignment.center
}
})
}
let photoEditViewController = PhotoEditViewController(photo: sampleImage!, configuration: configuration)
let toolStackController = ToolStackController(photoEditViewController: photoEditViewController)
toolStackController.delegate = self
toolStackController.navigationController?.view.backgroundColor = UIColor.red
present(toolStackController, animated: true, completion: nil)
Örnek projeniz var mı? –
yes @TimurBernikowich –
Cevabımı kontrol edin. –