meme

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HorizontalAlignment

type HorizontalAlignment int
const (
	Left   HorizontalAlignment = -1
	Center HorizontalAlignment = 0
	Right  HorizontalAlignment = 1
)

type Template

type Template struct {
	Name      string
	Image     image.Image
	TextSlots []*TextSlot
}

func (*Template) Render

func (t *Template) Render(text []string) (image.Image, error)

type TextLayout

type TextLayout struct {
	Face          font.Face
	Lines         []string
	LinePositions []fixed.Point26_6
}

type TextSlot

type TextSlot struct {
	Bounds              image.Rectangle
	Font                *truetype.Font
	MaxFontSize         float64
	HorizontalAlignment HorizontalAlignment
	VerticalAlignment   VerticalAlignment
	TextColor           color.Color
	OutlineColor        color.Color
	AllUppercase        bool
}

func (*TextSlot) Render

func (s *TextSlot) Render(img draw.Image, text string)

func (*TextSlot) TextLayout

func (s *TextSlot) TextLayout(text string) *TextLayout

type VerticalAlignment

type VerticalAlignment int
const (
	Top    VerticalAlignment = -1
	Middle VerticalAlignment = 0
	Bottom VerticalAlignment = 1
)

Jump to

Keyboard shortcuts

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