avatarbuilderMod

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AvatarBuilder

type AvatarBuilder struct {
	W int
	H int
	// contains filtered or unexported fields
}

func NewAvatarBuilder

func NewAvatarBuilder(fontFile string, calc FontCenterCalculator) *AvatarBuilder

func (*AvatarBuilder) GenerateImage

func (ab *AvatarBuilder) GenerateImage(s string) ([]byte, error)

func (*AvatarBuilder) GenerateImageAndSavePNG

func (ab *AvatarBuilder) GenerateImageAndSavePNG(s string) (string, error)

func (*AvatarBuilder) GenerateImageAndSaveSVG

func (ab *AvatarBuilder) GenerateImageAndSaveSVG(s string) (string, error)

func (*AvatarBuilder) GetFontWidth

func (ab *AvatarBuilder) GetFontWidth() int

func (*AvatarBuilder) SetAvatarSize

func (ab *AvatarBuilder) SetAvatarSize(w int, h int)

func (*AvatarBuilder) SetBackgroundColor

func (ab *AvatarBuilder) SetBackgroundColor(c color.Color)

func (*AvatarBuilder) SetBackgroundColorHex

func (ab *AvatarBuilder) SetBackgroundColorHex(hex uint32)

func (*AvatarBuilder) SetFontSize

func (ab *AvatarBuilder) SetFontSize(size float64)

func (*AvatarBuilder) SetFrontgroundColor

func (ab *AvatarBuilder) SetFrontgroundColor(c color.Color)

func (*AvatarBuilder) SetFrontgroundColorHex

func (ab *AvatarBuilder) SetFrontgroundColorHex(hex uint32)

type FontCenterCalculator

type FontCenterCalculator interface {
	// CalculateCenterLocation used to calculate center location in different font style
	CalculateCenterLocation(string, *AvatarBuilder) (int, int)
}

Jump to

Keyboard shortcuts

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