在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):ArtSabintsev/FontBlaster开源软件地址(OpenSource Url):https://github.com/ArtSabintsev/FontBlaster开源编程语言(OpenSource Language):Swift 90.6%开源软件介绍(OpenSource Introduction):FontBlasterProgrammatically load custom fonts into your iOS, macOS, and tvOS app.AboutSay goodbye to importing custom fonts via property lists as FontBlaster automatically imports and loads all fonts in your app's Bundles with one line of code. Features
Installation Instructions
CocoaPodspod 'FontBlaster' # Swift 5.1+
pod 'FontBlaster', :git => 'https://github.com/ArtSabintsev/FontBlaster.git', :branch => 'swift5.0' # Swift 5.0
pod 'FontBlaster', :git => 'https://github.com/ArtSabintsev/FontBlaster.git', :branch => 'swift4.2' # Swift 4.2
pod 'FontBlaster', :git => 'https://github.com/ArtSabintsev/FontBlaster.git', :branch => 'swift4.1' # Swift 4.1
pod 'FontBlaster', :git => 'https://github.com/ArtSabintsev/FontBlaster.git', :branch => 'swift3.2' # Swift 3.2
pod 'FontBlaster', :git => 'https://github.com/ArtSabintsev/FontBlaster.git', :branch => 'swift3.2' # Swift 3.1 Swift Package Manager.Package(url: "https://github.com/ArtSabintsev/FontBlaster.git", majorVersion: 4) Manual
SetupTypically, all fonts are automatically found in FontBlaster.blast() // Defaults to Bundle.main if no arguments are passed If you are loading from a bundle that isn't found inside your app's FontBlaster.blast(bundle:) // Takes one argument of type Bundle, or as mentioned above, defaults to Bundle.main if no arguments are passed If you need a list of all of the loaded fonts, an overloaded version of the // Defaults to Bundle.main as no argument is passed
FontBlaster.blast() { (fonts) in
print(fonts) // fonts is an array of Strings containing font names
}
// Custom bundle is passed as argument
FontBlaster.blast(bundle:) { (fonts) in
print(fonts) // fonts is an array of Strings containing font names
} To turn on console debug statements, simply set FontBlaster.debugEnabled = true
FontBlaster.blast() Sample ProjectA Sample iOS project is included in the repo. When you launch the app, all fonts are configured to load custom fonts, but don't actually display them until you push the button on the navigation bar. After pushing the button, FontBlaster imports your fonts and redraws the view. InspirationThis project builds upon an old solution that Marco Arment proposed and wrote about on his blog. Created and maintained by |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论