https://github.com/dfreniche/swiftfiglet
A Swift library to read and display banner like ASCII art messages using Figlet fonts
https://github.com/dfreniche/swiftfiglet
cli swift
Last synced: 4 months ago
JSON representation
A Swift library to read and display banner like ASCII art messages using Figlet fonts
- Host: GitHub
- URL: https://github.com/dfreniche/swiftfiglet
- Owner: dfreniche
- Created: 2020-05-08T17:18:48.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-13T15:59:34.000Z (about 6 years ago)
- Last Synced: 2025-03-28T01:44:32.718Z (about 1 year ago)
- Topics: cli, swift
- Language: Swift
- Homepage:
- Size: 1.32 MB
- Stars: 18
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SwiftFigletKit
```
##### ####### # #
# # # # # ###### ##### # # #### # ###### ##### # # # #####
# # # # # # # # # # # # # # # # #
##### # # # ##### # ##### # # # ##### # ### # #
# # ## # # # # # # # ### # # # # # # #
# # ## ## # # # # # # # # # # # # # #
##### # # # # # # # #### ###### ###### # # # # #
```
A simple library to read and display [banner](https://en.wikipedia.org/wiki/Banner_(Unix)) like ASCII art messages using [Figlet](http://www.figlet.org/) fonts
## Installation
- 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` and `SFKFigletFile`
## Limitations
- this is a macOS library, for CLI programs. Can be adapted for iOS.
- Only Figlet font files are supported (.flf)
- If you have trouble loading a flf file, open an issue and attach font file, please.
## How to Use
- Load a `SFKFont` with
```swift
import SwiftFigletKit
let font = SFKFont.from(file: "fonts/starwars.flf")
```
- Once loaded, you can start printing to the console using
```swift
print(string: "Swift Figlet Kit", usingFont: font)
```
- No step 3. Told you it was a simple library 😅
## TODO
- [x] Finish this README 😅
- [x] add MIT license notice
- [x] Add Swift Figlet File property as optional after loading a `SFKFont` from disk
- [x] Remove [Toilet fonts](http://caca.zoy.org/wiki/toilet) 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
- [x] test font `Wow.flf` with mixed line endings (`CR/LF` and `CR`)
- [ ] adapt file loading for iOS
- [ ] honor right to left print direction
## Fonts used
I've used the Figlet fonts from [xero's](https://github.com/xero/figlet-fonts) repo
## License
MIT