typography

package
v0.0.0-...-e6da677 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2013 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package typography handles printing text on a graphical display.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitToLines

func SplitToLines(measure WidthMeasure, text string, maxWidth float64) (result []string)

Types

type Edge

type Edge uint8
const (
	None Edge = iota
	Emboss
	DropShadow
	Round
	Blocky
)

type Style

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

func NewStyle

func NewStyle(fontSpec font.Spec) *Style

func (*Style) BackColor

func (s *Style) BackColor(col color.Color) *Style

func (*Style) Bounds

func (s *Style) Bounds(line string) image.Rectangle

func (*Style) Colors

func (s *Style) Colors(foreColor, backColor color.Color) *Style

func (*Style) Edge

func (s *Style) Edge(edge Edge) *Style

func (*Style) ForeColor

func (s *Style) ForeColor(col color.Color) *Style

func (*Style) LineHeight

func (s *Style) LineHeight() float64

func (*Style) Render

func (s *Style) Render(line string, pos image.Point)

func (*Style) RenderOn

func (s *Style) RenderOn(target gfx.Surface32Bit, line string, pos image.Point)

func (*Style) StringWidth

func (s *Style) StringWidth(line string) float64

type WidthMeasure

type WidthMeasure interface {
	StringWidth(line string) float64
}

Jump to

Keyboard shortcuts

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