txtg

package
v0.0.0-...-33c57cd Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2015 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CircleStretchFactor float64 = 1.85
View Source
var Edge = [][4]rune{{'+', '+', '+', '+'}, {'.', '.', '\'', '\''}, {'/', '\\', '\\', '/'}}

Different edge styles for boxes

Functions

func StrLen

func StrLen(s string) (n int)

Return real character len of s (rune count).

Types

type TextBuf

type TextBuf struct {
	Buf  []rune // the internal buffer.  Point (x,y) is mapped to x + y*(W+1)
	W, H int    // Width and Height
}

A Text Buffer

func NewTextBuf

func NewTextBuf(w, h int) (tb *TextBuf)

Set up a new TextBuf with width w and height h.

func (*TextBuf) Block

func (tb *TextBuf) Block(x, y, w, h int, fill rune)

func (*TextBuf) Line

func (tb *TextBuf) Line(x0, y0, x1, y1 int, symbol rune)

func (*TextBuf) Paste

func (tb *TextBuf) Paste(x, y int, buf *TextBuf)

Paste buf at (x,y)

func (*TextBuf) Put

func (tb *TextBuf) Put(x, y int, c rune)

Put character c at (x,y)

func (*TextBuf) Rect

func (tb *TextBuf) Rect(x, y, w, h int, style int, fill rune)

Draw rectangle of width w and height h from corner at (x,y). Use one of the corner style defined in Edge. Interior is filled with charater fill iff != 0.

func (*TextBuf) String

func (tb *TextBuf) String() string

Convert to plain (utf8) string.

func (*TextBuf) Text

func (tb *TextBuf) Text(x, y int, txt string, align int)

Print text txt at (x,y). Horizontal display for align in [-1,1], vasrtical alignment for align in [2,4] align: -1: left; 0: centered; 1: right; 2: top, 3: center, 4: bottom

type TextGraphics

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

TextGraphics

func New

func New(w, h int) *TextGraphics

New creates a TextGraphic of dimensions w x h.

func (*TextGraphics) Background

func (tg *TextGraphics) Background() (r, g, b, a uint8)

func (*TextGraphics) Bars

func (g *TextGraphics) Bars(bars []chart.Barinfo, style chart.Style)

func (*TextGraphics) Begin

func (g *TextGraphics) Begin()

func (*TextGraphics) Boxes

func (g *TextGraphics) Boxes(boxes []chart.Box, width int, style chart.Style)

func (*TextGraphics) Dimensions

func (g *TextGraphics) Dimensions() (int, int)

func (*TextGraphics) End

func (g *TextGraphics) End()

func (*TextGraphics) FontMetrics

func (g *TextGraphics) FontMetrics(font chart.Font) (fw float32, fh int, mono bool)

func (*TextGraphics) Key

func (g *TextGraphics) Key(x, y int, key chart.Key, options chart.PlotOptions)

func (*TextGraphics) Line

func (g *TextGraphics) Line(x0, y0, x1, y1 int, style chart.Style)

func (*TextGraphics) Options

func (g *TextGraphics) Options() chart.PlotOptions

func (*TextGraphics) Path

func (g *TextGraphics) Path(x, y []int, style chart.Style)

func (*TextGraphics) Rect

func (g *TextGraphics) Rect(x, y, w, h int, style chart.Style)

func (*TextGraphics) Rings

func (g *TextGraphics) Rings(wedges []chart.Wedgeinfo, x, y, ro, ri int)

func (*TextGraphics) Scatter

func (g *TextGraphics) Scatter(points []chart.EPoint, plotstyle chart.PlotStyle, style chart.Style)

func (*TextGraphics) String

func (g *TextGraphics) String() string

func (*TextGraphics) Symbol

func (g *TextGraphics) Symbol(x, y int, style chart.Style)

func (*TextGraphics) Text

func (g *TextGraphics) Text(x, y int, t string, align string, rot int, font chart.Font)

func (*TextGraphics) TextLen

func (g *TextGraphics) TextLen(t string, font chart.Font) int

func (*TextGraphics) Wedge

func (g *TextGraphics) Wedge(x, y, ro, ri int, phi, psi float64, style chart.Style)

func (*TextGraphics) XAxis

func (g *TextGraphics) XAxis(xrange chart.Range, y, y1 int, options chart.PlotOptions)

func (*TextGraphics) YAxis

func (g *TextGraphics) YAxis(yrange chart.Range, x, x1 int, options chart.PlotOptions)

Jump to

Keyboard shortcuts

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