text

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alignment

type Alignment int

Alignment is a text alignment

const (
	// AlignmentLeft aligns text left
	AlignmentLeft Alignment = iota
	// AlignmentRight aligns text right
	AlignmentRight
	// AlignmentCentre aligns text centrally
	AlignmentCentre
)

type Component

type Component struct {
	NamedPropertiesMap map[string][]string
	Content            string
	Start              image.Point
	Size               float64
	MaxWidth           int
	Alignment          Alignment
	Font               *truetype.Font
	Colour             color.NRGBA
	// contains filtered or unexported fields
}

Component implements the Component interface for text

func (Component) GetJSONFormat

func (component Component) GetJSONFormat() interface{}

GetJSONFormat returns the JSON structure of a text component

func (Component) SetNamedProperties

func (component Component) SetNamedProperties(properties render.NamedProperties) (render.Component, error)

SetNamedProperties proceses the named properties and sets them into the text properties

func (Component) VerifyAndSetJSONData

func (component Component) VerifyAndSetJSONData(data interface{}) (render.Component, render.NamedProperties, error)

VerifyAndSetJSONData processes the data parsed from JSON and uses it to set text properties and fill the named properties map

func (Component) Write

func (component Component) Write(canvas render.Canvas) (c render.Canvas, err error)

Write draws text on the canvas

Jump to

Keyboard shortcuts

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