stamp

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MARGIN_PER_LINE      = 24
	MIN_CHAR_NUM_IN_LINE = 3
)

Variables

This section is empty.

Functions

func CalculateFontSize

func CalculateFontSize(maxChatNumInOneLine int, width int) float64

CalculateFontSize calculates the font size based on the maximum number of characters in one line and the width.

func Export

func Export(imgBytes []byte, filePath string) error

func Generate

func Generate(text string, width int, height int, fontColor string, externalFontPath string, shouldOneLine bool) ([]byte, error)

func GenerateRandomHexColor

func GenerateRandomHexColor() (string, error)

GenerateRandomHexColor generates a random hex color.

func LoadFont

func LoadFont(fontSize float64, externalFontFilePath string) (font.Face, error)

LoadFont loads the font based on the font size and the external font file path.

func ParseHexColor

func ParseHexColor(s string) (c color.RGBA, err error)

ParseHexColor parses a hex color string to a color.RGBA.

Types

This section is empty.

Jump to

Keyboard shortcuts

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