font

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Color added in v0.3.0

type Color int

Color is type of colors

const (
	// Black represents black color
	Black Color = iota
	// Red represents red color
	Red
	// Green represents green color
	Green
	// Blue represents blue color
	Blue
	// White represents white color
	White
)

func ColorFromString added in v0.3.0

func ColorFromString(c string) (Color, error)

ColorFromString convert string to Color type

func (Color) RGBA added in v0.3.0

func (c Color) RGBA() *image.Uniform

RGBA convert Color type to image.Uniform type

type EmojiDrawer

type EmojiDrawer struct {
	// contains filtered or unexported fields
}

EmojiDrawer is the struct for drawing emoji

func NewEmojiDrawer

func NewEmojiDrawer(bundlePath string) (*EmojiDrawer, error)

NewEmojiDrawer returns initialized EmojiDrawer

func (*EmojiDrawer) GenerateEmoji

func (e *EmojiDrawer) GenerateEmoji(emoji *EmojiInfo) ([]byte, error)

GenerateEmoji generate the image of emoji and returns it as []byte format

type EmojiInfo added in v0.3.0

type EmojiInfo struct {
	Name            string
	Text            string
	FontColor       Color
	BackgroundColor Color
}

EmojiInfo is the struct that store emoji info by users

func NewEmojiInfoFromLine added in v0.3.0

func NewEmojiInfoFromLine(text string) (*EmojiInfo, error)

NewEmojiInfoFromLine parse text into EmojiInfo

Jump to

Keyboard shortcuts

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