textfit

package module
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2022 License: Apache-2.0 Imports: 5 Imported by: 1

README

textfit

The textfit component consumes text bodies and plans for how to fit those bodies to a given rectangle, and outputs fitted and resized text appropriately.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustNew

func MustNew(options ...Option) render.Modifiable

func New

func New(options ...Option) (render.Modifiable, error)

Types

type BreakStyle

type BreakStyle byte
const (
	BreakStyleCharacter BreakStyle = iota
	BreakStyleWord
)

type Generator

type Generator struct {
	Text       string
	Font       *render.Font
	Dimensions floatgeom.Point2
	MinSize    int
	MaxSize    int
	BreakStyle
	RelativePos floatgeom.Point2
}

type Option

type Option (func(*Generator))

func Dimensions

func Dimensions(p floatgeom.Point2) Option

func Font

func Font(f *render.Font) Option

func Inset

func Inset(w, h float64) Option

func MaxSize

func MaxSize(max int) Option

func MinSize

func MinSize(min int) Option

func String

func String(s string) Option

func WithBreakStyle

func WithBreakStyle(bs BreakStyle) Option

Jump to

Keyboard shortcuts

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