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)
请帮我添加自定义字体
我也使用Fontimporter类来加载自定义字体,如@L_502_0@所示
谢谢…
您可以在类InstanceFactory on GitHub中找到此方法.类方法混合样本:Gist
总结以上是内存溢出为你收集整理的如何使用Swift将自定义字体添加到iOS中的imglyKit SDK中?全部内容,希望文章能够帮你解决如何使用Swift将自定义字体添加到iOS中的imglyKit SDK中?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)