figlet4go

package module
v0.0.0-...-bc87934 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2016 License: MIT Imports: 8 Imported by: 14

README

figlet4go

 _______  __    _______  __       _______ .___________. _  _      _______   ______
|   ____||  |  /  _____||  |     |   ____||           || || |    /  _____| /  __  \
|  |__   |  | |  |  __  |  |     |  |__   `---|  |----`| || |_  |  |  __  |  |  |  |
|   __|  |  | |  | |_ | |  |     |   __|      |  |     |__   _| |  | |_ | |  |  |  |
|  |     |  | |  |__| | |  `----.|  |____     |  |        | |   |  |__| | |  `--'  |
|__|     |__|  \______| |_______||_______|    |__|        |_|    \______|  \______/

A port of figlet to golang.
Make it easier to use,add some new feature such as colorized outputs.

Usage

Install
go get -u github.com/getwe/figlet4go
Demo
cd demo/
go build
./demo -str="golang"
#Maybe you have to `brew install figlet` if you need 3D fond in mac osx.

see details in demo/demo.go .

screenshot

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsciiRender

type AsciiRender struct {
	// contains filtered or unexported fields
}

func NewAsciiRender

func NewAsciiRender() *AsciiRender

func (*AsciiRender) LoadFont

func (this *AsciiRender) LoadFont(fontPath string) error

walk through the path, load all the *.flf font file

func (*AsciiRender) Render

func (this *AsciiRender) Render(asciiStr string) (string, error)

render with default options

func (*AsciiRender) RenderOpts

func (this *AsciiRender) RenderOpts(asciiStr string, opts *RenderOptions) (string, error)

render with options

type RenderOptions

type RenderOptions struct {
	FontName string // font name

	FontColor []color.Attribute // every ascii byte's color
}

func NewRenderOptions

func NewRenderOptions() *RenderOptions

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL