mirror of
https://github.com/KevinMidboe/motdGOi.git
synced 2025-10-29 17:50:24 +00:00
add badge, few improvements
This commit is contained in:
@@ -3,10 +3,9 @@
|
|||||||
`figlet4go` is a go library forked from [getwe/figlet4go](https://github.com/getwe/figlet4go) which is a port of [FIGlet](http://www.figlet.org/) to Golang.
|
`figlet4go` is a go library forked from [getwe/figlet4go](https://github.com/getwe/figlet4go) which is a port of [FIGlet](http://www.figlet.org/) to Golang.
|
||||||
With `figlet4go` it's easy to create **ascii text banners** in the command-line or with the given api.
|
With `figlet4go` it's easy to create **ascii text banners** in the command-line or with the given api.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
[](https://goreportcard.com/report/github.com/probandula/figlet4go)
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ var (
|
|||||||
str *string = flag.String("str", "", "String to be converted with FIGlet")
|
str *string = flag.String("str", "", "String to be converted with FIGlet")
|
||||||
font *string = flag.String("font", "", "Font name to use")
|
font *string = flag.String("font", "", "Font name to use")
|
||||||
fontpath *string = flag.String("fontpath", "", "Font path to load fonts from")
|
fontpath *string = flag.String("fontpath", "", "Font path to load fonts from")
|
||||||
colors *string = flag.String("colors", "", "Character colors seperated by ';'\n\tPossible colors: black, red, green, yellow, blue, magenta, cyan, white")
|
colors *string = flag.String("colors", "", "Character colors separated by ';'\n\tPossible colors: black, red, green, yellow, blue, magenta, cyan, white")
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -54,7 +54,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get a slice with colors to give to the RenderOptions
|
// Get a slice with colors to give to the RenderOptions
|
||||||
// Splits the given string with the seperator ";"
|
// Splits the given string with the separator ";"
|
||||||
func getColorSlice(colorStr string) []color.Attribute {
|
func getColorSlice(colorStr string) []color.Attribute {
|
||||||
|
|
||||||
givenColors := strings.Split(colorStr, ";")
|
givenColors := strings.Split(colorStr, ";")
|
||||||
|
|||||||
2
font.go
2
font.go
@@ -1,3 +1,4 @@
|
|||||||
|
package figlet4go
|
||||||
// Explanation of the .flf file header
|
// Explanation of the .flf file header
|
||||||
// THE HEADER LINE
|
// THE HEADER LINE
|
||||||
//
|
//
|
||||||
@@ -16,7 +17,6 @@
|
|||||||
// * The two layout parameters are closely related and fairly complex.
|
// * The two layout parameters are closely related and fairly complex.
|
||||||
// (See "INTERPRETATION OF LAYOUT PARAMETERS".)
|
// (See "INTERPRETATION OF LAYOUT PARAMETERS".)
|
||||||
//
|
//
|
||||||
package figlet4go
|
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|||||||
@@ -85,9 +85,9 @@ func (fm *fontManager) loadFontList(fontPath string) error {
|
|||||||
|
|
||||||
// Load a font from disk
|
// Load a font from disk
|
||||||
// The font must be registered in the fontList
|
// The font must be registered in the fontList
|
||||||
func (this *fontManager) loadDiskFont(fontName string) error {
|
func (fm *fontManager) loadDiskFont(fontName string) error {
|
||||||
// Get the fontpath
|
// Get the fontpath
|
||||||
path, ok := this.fontList[fontName]
|
path, ok := fm.fontList[fontName]
|
||||||
// Font is not registered
|
// Font is not registered
|
||||||
if !ok {
|
if !ok {
|
||||||
return errors.New("Font Not Found: " + fontName)
|
return errors.New("Font Not Found: " + fontName)
|
||||||
@@ -106,7 +106,7 @@ func (this *fontManager) loadDiskFont(fontName string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Register the font object in the fontLib
|
// Register the font object in the fontLib
|
||||||
this.fontLib[fontName] = font
|
fm.fontLib[fontName] = font
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user