captcha

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: Unlicense Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(fonts ...string)

Init FontName|FontFile FontName|FontFile|FontSize FontName|FontFile|FontSize|ASCII Half Width

func RegisterFont

func RegisterFont(name, file string, options *truetype.Options, asciiHalfWidth bool)

func RenderOneFont

func RenderOneFont(fontname string, txt []rune, option *Options) image.Image

func RenderSomeFonts

func RenderSomeFonts(count int, txt []rune, option *Options) image.Image

Types

type Generator added in v0.0.5

type Generator interface {
	GenerateTo(ctx context.Context, w io.Writer) error
}

func NewRandTokenGenerator added in v0.0.5

func NewRandTokenGenerator(fn TokenGenerator, fontname string, opt *Options) Generator

func NewShuffleStringGenerator added in v0.0.5

func NewShuffleStringGenerator(fn TokensGenerator, fontname string, opt *ShuffleOptions) Generator

type Options

type Options struct {
	OffsetX int
	OffsetY int
	Points  int
	Color   color.Color
}

type ShuffleOptions added in v0.0.5

type ShuffleOptions struct {
	Options
	PCT int
	Sep []rune
}

type TokenGenerator added in v0.0.5

type TokenGenerator func(ctx context.Context) string

type TokensGenerator added in v0.0.5

type TokensGenerator func(ctx context.Context) []string

Jump to

Keyboard shortcuts

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