draw

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const FillLength = 224
View Source
const FontUrl = "https://raw.githubusercontent.com/hellflame/terminal_printer/" +
	"808004a7cd41b4383bfe6aa310c491c69d9b2556/fonts/"
View Source
const VERSION = "v1.0.1"

Variables

View Source
var DefaultFonts = []string{"shuyan.ttf", "letter.ttf",
	"Haibaoyuanyuan.ttf", "fengyun.ttf"}
View Source
var DefaultHeight = 80
View Source
var DefaultWidth = 50
View Source
var FillBytes []int
View Source
var FontBase string
View Source
var IsShabby = false

Functions

func Clip

func Clip(img *image.Gray) image.Image

Clip will clip text image to right size for golang doesn't have any direct way to get render string size

func GeneratePixel

func GeneratePixel(img *image.Image, fillIndex int, colorCode int,
	reverse bool, grayMode bool, shadeCliff uint8) string

GeneratePixel create terminal string for print use

func LoadImage

func LoadImage(imgPath string) image.Image

LoadImage for next use

func Text

func Text(text string, fontPath string) *image.Gray

Text render text with given font

Types

This section is empty.

Jump to

Keyboard shortcuts

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