##### ####### # #
# # # # # ###### ##### # # #### # ###### ##### # # # #####
# # # # # # # # # # # # # # # # #
##### # # # ##### # ##### # # # ##### # ### # #
# # ## # # # # # # # ### # # # # # # #
# # ## ## # # # # # # # # # # # # # #
##### # # # # # # # #### ###### ###### # # # # #
A simple library to read and display banner like ASCII art messages using Figlet fonts
- Add FigletKit to your project using Swift Package Manager. From Xcode add this repo as a package.
- Or clone this repo and copy over the required four files:
SFKFont
,SFKChar
,SFKBanner
andSFKFigletFile
- SwiftFigletKit targets Apple platforms (iOS, macOS, tvOS and watchOS) and prints to standard output.
- Only Figlet font files are supported (.flf)
- If you have trouble loading a flf file, open an issue and attach font file, please.
- Load a bundled
SFKFont
import SwiftFigletKit
if let url = Bundle.module.url(forResource: "starwars", withExtension: "flf", subdirectory: "Fonts"),
let font = SFKFont.from(url: url) {
print(string: "Swift Figlet Kit", usingFont: font)
}
- Or let the package choose a random bundled font for you
if let font = SFKFont.random() {
print(string: "Swift Figlet Kit", usingFont: font)
}
- No step 3. Told you it was a simple library 😅
- Finish this README 😅
- add MIT license notice
- Add Swift Figlet File property as optional after loading a
SFKFont
from disk - Remove Toilet fonts from fonts sample dir: won't support them
- Add support for lines adding Unicode character to be loaded, like
196 LATIN CAPITAL LETTER A WITH DIAERESIS
, see Banner.flf - test font
Wow.flf
with mixed line endings (CR/LF
andCR
) - adapt file loading for iOS
- honor right to left print direction
I've used the Figlet fonts from xero's repo
MIT