banner

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2018 License: MIT Imports: 6 Imported by: 2

Documentation

Overview

Package banner is a dynamic ASCII art banner generator.

This package supports loading fonts at runtime and can parse arbitrary ASCII art fonts.

Index

Constants

View Source
const GlyphTable = `` /* 211-byte string literal not displayed */

GlyphTable describes the ordering and formatting expected by the banner package when parsing font data.

This table can be used to generate new fonts using patorjk's timeless ASCCI generator at http://patorjk.com/software/taag/. Copy this table and paste it into the generator to get a nice chunk of ASCII goodness that can be used as a font with this package.

You may need to add an extra new-line between each row to ensure the parser can separate them correctly.

Variables

This section is empty.

Functions

func Printf

func Printf(format string, a ...interface{})

func Sprintf

func Sprintf(format string, a ...interface{}) string

Types

type Font

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

A Font is a data type that contains information necessary to render text using arbitrary ASCII art fonts.

var DefaultFont *Font

func NewFont

func NewFont(file string) (*Font, error)

NewFont attempts to read the font data stored in file. If this function cannot parse the font data, an error will be returned.

Fonts can be created using http://patorjk.com/software/taag/. Select a font, then paste in the GlyphsTable text. Copy the output and place it in a file or use NewFontString to parse the font.

func NewFontString

func NewFontString(font string) (*Font, error)

NewFontString attempts to parse the font data passed in as a string. If this function cannot parse the font data, an error will be returned.

func (*Font) Size

func (f *Font) Size() int

type Sequence

type Sequence []*letter

A Sequence is a sequence of letters representing an ASCII banner.

func New

func New(f *Font, s string) Sequence

New creates a new ASCII art banner using the given font and string input.

func (Sequence) String

func (l Sequence) String() string

Jump to

Keyboard shortcuts

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