figlet4go

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2019 License: MIT Imports: 7 Imported by: 1

README

Build Status

figlet4go

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

This is a fork of the original project from getwe but since there wasn't any activity in a while, managing the fork seemed more sensible than opening a PR and waiting, and waiting. The changes here are meant to make it closer to go conventions and mainly, provide more visibility to the caller as far as custom font loading (instead of silently falling back to default). I'll happily review and merge PRs, too.

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