text2img

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToImage

func ToImage(text string, writer io.Writer, options ...Options) error

Types

type ImageType

type ImageType string
const (
	ImageTypePNG ImageType = "png"
	ImageTypeJPG ImageType = "jpg"
	ImageTypeGIF ImageType = "gif"
)

type Option

type Option struct {
	FontSize           float64
	Margin             int
	LineSpacing        float64
	BackgroundHexColor string
	FontHexColor       string
	FontReader         io.ReadCloser
	ImageType          ImageType
}

type Options

type Options func(*Option)

func WithBackgroundHexColor

func WithBackgroundHexColor(color string) Options

func WithFontHexColor

func WithFontHexColor(color string) Options

func WithFontReader

func WithFontReader(reader io.ReadCloser) Options

func WithFontSize

func WithFontSize(size float64) Options

func WithImageType

func WithImageType(imageType ImageType) Options

func WithLineSpacing

func WithLineSpacing(spacing float64) Options

func WithMargin

func WithMargin(margin int) Options

Jump to

Keyboard shortcuts

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