ProductPromotion
Logo

Swift

made by https://0x3d.site

GitHub - ArtSabintsev/FontBlaster: Programmatically load custom fonts into your iOS, macOS and tvOS app.
Programmatically load custom fonts into your iOS, macOS and tvOS app. - ArtSabintsev/FontBlaster
Visit Site

GitHub - ArtSabintsev/FontBlaster: Programmatically load custom fonts into your iOS, macOS and tvOS app.

GitHub - ArtSabintsev/FontBlaster: Programmatically load custom fonts into your iOS, macOS and tvOS app.

FontBlaster

Programmatically load custom fonts into your iOS, macOS, and tvOS app.

Swift Support Platform CocoaPods SwiftPM Compatible


About

Say 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

  • CocoaPods Support
  • Swift PM Support
  • Automatically imports fonts from Bundle.main
  • Able to import fonts from remote bundles
  • Sample Project

Installation Instructions

Swift Version Branch Name Will Continue to Receive Updates?
5.1+ master Yes
5.0 swift5.0 No
4.2 swift4.2 No
4.1 swift4.1 No
3.2 swift3.2 No
3.1 swift3.1 No

CocoaPods

pod '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

  1. Download FontBlaster.
  2. Copy FontBlaster.swift into your project.

Setup

Typically, all fonts are automatically found in Bundle.main. Even if you have a custom bundle, it's usually lodged inside of the mainBundle. Therefore, to load all the fonts in your application, irrespective of the bundle it's in, simply call:

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 mainBundle, simply pass a reference to your Bundle in the blast(_:) method:

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 blast(_:) method has a completion handler that returns just that. Just like the original method, this method takes either a custom Bundle or defaults to Bundle.main if no argument is passed.


// 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 debugEnabled() = true before calling either blast() method:

FontBlaster.debugEnabled = true
FontBlaster.blast()

Sample Project

A 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.

Inspiration

This project builds upon an old solution that Marco Arment proposed and wrote about on his blog.

Created and maintained by

Arthur Ariel Sabintsev

More Resources
to explore the angular.

mail [email protected] to add your project or resources here ๐Ÿ”ฅ.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here ๐Ÿ”.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory